I’m wondering if there’s any way to filter an input string based on a set stored in influxdb2.
e.g: here’s the (Java) entity that is being stored in influxdb2
The goal here is to filter based on tags, say if any stored record contains a tag: “tag1”. Based on my limited knowledge of flux, I was thinking of using contains but seems that it’s not working:
As you said, this configuration causes that the tags are saved as a string. The corresponding LineProtocol looks like: blah_blah,tags=[tag1\,\ tag2] value=6i 1643897137.
You have to separate your tags to string fields:
@Measurement(name = "blah_blah")
public class EntityName {
@Column(timestamp = true)
private Instant time;
@Column(tag = true)
private String tagA;
@Column(tag = true)
private String tagB;
@Column
private long value;
}
I think it’s not possible, since field: tags here will have variable length & might accept different values, say, an entity might have 2 tags & another one might contain 10 tags. Is there any way to search for array fields in influxdb2 ?
What do you think by tag? Is it a structure corresponding to the definition of InfluxDB’s tag: key-value - location=north,type=production,state=ready? Or is it just values like - north, production, ready?
Sorry, I should have thought that the name could be misleading. It’s definitely not the influxdb tag, but just random set of string values as you mentioned (second option) received by user
So, I’m guessing there’s no way to achieve this (searching for a term within a saved array of values) in InfluxDB (since the array itself is being stored as string?). If I"m mistaken, please let me know.
Regards.