Flux query returns only the data from one tagset


I’m using influx OSS 1.8 on windows to try out the new flux language, so we can port our client application from InfluxQL to Flux
I experimented a bit with it and start to develop an understanding on how it works, but i have a problem: it does not seem to return all data compared to InfluxQL

This is my data
metrics,device=toaster heat=0,energy=1 1588179706000000000
metrics,device=toaster heat=5,energy=3 1588179707000000000
metrics,device=toaster heat=500,energy=40 1588179708000000000
metrics,device=oven heat=0,energy=1 1588179706000000000
metrics,device=oven heat=100,energy=10 1588179707000000000
metrics,device=oven heat=200,energy=20 1588179708000000000

I put it directly into influxdb using curl

When i query it using influxql with a simple
SELECT * FROM metrics
I get all of it back

however, if i’m using flux
|> range(start:0)
it only ever returns values with the device toaster, oven is nowhere to be found
When i add file(fn: ® => r.device == “oven”), the result is completely empty (which is somehwat to be expected when it’s not even there unfiltered)

I execute my queries using
curl -sS -XPOST localhost:8086/api/v2/query?epoch=ns -H “Accept:text/csv” -H “Content-type:application/vnd.flux” -d @fluxquery.txt

Am i missing something obvious?
I already tried the flux documentation with the keys() and column() function, but i only ever see toaster, never the oven

Hello @woegster,
Where are you executing your query? The data will be split into separate flux tables. Adding a |>group() might help you visualize your data in the way you expect. I also highly recommend using the UI/query builder to learn flux–it’s a great learning tool. :slight_smile:

Thanks for your response!
I tried it again today an now suddenly, everything works as expected, without any modification to my query - worst case it was some weird caching issue :confused:

Anyway’s it working know i did not know you could do flux testing in chronograf. This is wonderful and beats my old workflow of “change a script file, alt-tab to a shell, press up and run curl again” by a lot!

Thanks again, this issue is solved for me :slight_smile:

1 Like

No problem! I’m happy it’s working again :). Yah I’ve had a couple caching issues with Chrome before…when in doubt Incognito I guess…

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.