Hi,
I have a bucket called “testdb” and I’m trying to execute some simple queries on it.
The structure of the bucket is very simple and (i think) is not important for the purpose of the question.
If I execute the following query I expect to get all the messages within the specified time range.
from(bucket: "testdb")
|> range(start: 2022-04-01T00:00:00Z, stop: 2022-04-28T00:00:00Z)
The result is composed of the following tables. The only difference between the tables is given by the topic tag. This made me think that in my bucket there was only “diagnostic” topic and its sub-topics.
If I execute the following query I expect to get a subset of the first query where the topics contain the “event” keyword. Since the query above does not return any table with the “event” keyword i expect to get an empty result, but it is not what I get.
import "strings"
from(bucket: "testdb")
|> range(start: 2022-04-01T00:00:00Z, stop: 2022-04-28T00:00:00Z)
|> filter(fn: (r) => strings.containsStr(v: r.topic, substr: "event"))
Query result:
So, summing up the question: Why the more general query does not return the “diagnostic” + “event” records?
Thanks in advance for the patience.
Edit:
Even executing the query
import "strings"
from(bucket: "testdb")
|> range(start: 2022-04-01T00:00:00Z, stop: 2022-04-28T00:00:00Z)
|> filter(fn: (r) => strings.containsStr(v: r.topic, substr: "event") or strings.containsStr(v: r.topic, substr: "diagnostic"))
I get the same result as the first query. (only “diagnostic” topics)