How to use goliothctl to query stream data for a single device?

Description

I’d like to get all historical data for some parameters in a time period from a single device into a CSV-file for local analysis.

Following the documentation for goliothctl stream query (goliothctl stream query | Golioth), I tried setting up a query-file, but I’m not able to filter on deviceId. Filtering on another parameter works fine, but filtering on “deviceId” only gives “null” as output.

This filter works as expected:
{ “path”:“Vbatt”, “op”:“=”, “value”: 9099}

This filter gives no output, even when copying said deviceId from the response above:
{ “path”:“deviceId”, “op”:“=”, “value”: “”}

For the other stream commands like listen and get, there is the “device name”-parameter available. This does not seem to be there for query, though. I’m aware I could do this fairly easily with the REST API, but I was planning on just quickly getting this data into a file, so thought that using goliothctl would be faster :sweat_smile:

Expected Behavior

A json array of the requested data.

Actual Behavior

“null” is returned.

Environment

goliothctl CLI command.

Logs and Console Output

None

Hey @asgeir.s.hustad,

Thanks for reaching out! You’re correct—at the moment, filtering based on deviceId in goliothctl stream query is not supported.

That said, we understand the need for this feature, and we’ll keep you updated on the progress as we make improvements. In the meantime, as you mentioned, the REST API is a good alternative for fetching historical data from a single device into a CSV file.