Executing 'show series' using golang influxdb client package returns all fields in single string

When I execute a SHOW series ON <db> FROM <measurement> WHERE "<tag-key-name>"='somevalue' using the github.com/influxdata/influxdb/client/v2 library, I get the result back as a Series where each Row in result.Series.Values is a single string looking like InfluxDB line protocol with the measurement, tag-key names and tag-key values.

However I need the value of each of the tag-key individually. Anyone have any idea how I can achieve this? I was thinking maybe parsing the string as line-protocol, but I would prefer some way where I can look up the tag-fields in a map, like for select-queries.

I found a workaround on stackoverflow.

By using a select query instead, and using group by + limit + order by, I can fetch all the unique tag-sets (plus one field value that I do not use) for a given where clause.

I am still interested in being able to use show series for this though, as I believe it to be more appropriate giving the context I’m working with (want to list the series in a measurement given a where clause), but the most important thing after all is that it works.

1 Like

Hello @andoks,
Thank you for your question. I’m happy you found a solution. Can you please create an issue so we can improve the experience?

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