I just got stared with Influx and it feels really cool!
I have a scenario where I would like to store data points like this:
mesurement tagFoo tagBar fieldText fieldNumber
foo tag1 tagA demo 1
foo tag1 tagA demo 1
foo tag1 tagA demo 1
foo tag1 tagA foobar 1
foo tag1 tagA foobar 1
foo tag1 tagA foobar 1
I always want to store the value 1 for my data point as it’s a event and my idea is to use the sum()-function to calculate the number of events for given time frames. I have a “bucket” in Influx Cloud configured like this and populated with data but when i perform queries it comes back like to different sets:
#group1
mesurement tagFoo tagBar fieldNumber
foo tag1 tagA 1
foo tag1 tagA 1
foo tag1 tagA 1
#group1
mesurement tagFoo tagBar fieldText
foo tag1 tagA foobar
foo tag1 tagA foobar
foo tag1 tagA foobar
My query is very simple, something like this:
from(bucket: “test”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: ® => r._measurement == “foo”)
|> yield()
- First of all I would like to get the data back as one table (like below) all the examples I’ve seen presents the data like this - what I’m I doing wrong?
mesurement tagFoo tagBar fieldText fieldNumber
foo tag1 tagA demo 1
foo tag1 tagA demo 1
foo tag1 tagA demo 1
foo tag1 tagA foobar 1
foo tag1 tagA foobar 1
foo tag1 tagA foobar 1
- My end goal would be to come up with a query that would sum the “fieldNumber” and present the table like this:
mesurement tagFoo tagBar fieldText fieldNumber
foo tag1 tagA demo 3
foo tag1 tagA foobar 3
Any pointers towards how I would write a query to get that?
Thank you =D