6

I am trying to fetch the tag values for a given measurement. i have my measurement in influxDB as given below.

> select * from "EVENT_LIVE" name: EVENT_LIVE time GROUP_ID COUNT ---- ------------- --------- 1531008000000000000 84 2 1531008000000000000 9 8 1532822400000000000 249 1 1534636800000000000 43 1 1534636800000000000 68 1 1535241600000000000 13 13 1535241600000000000 18 4 1535241600000000000 205 2 1535241600000000000 21 6 1535241600000000000 214 1 1535241600000000000 23 1 1535241600000000000 238 1 1535241600000000000 249 1 1535241600000000000 282 14 1535241600000000000 29 1 1535241600000000000 316 3 1535241600000000000 32 13 1535241600000000000 41 7 1535241600000000000 43 1 1535241600000000000 6 1 

Here the name of the measurement is EVENT_LIVE and GROUP_ID is the tag and the COUNT is the value for the measurement.

i have executed the below influxDB query.

 > show tag values with key=GROUP_ID name: EVENT_LIVE key value --- ----- GROUP_ID 13 GROUP_ID 18 GROUP_ID 204 GROUP_ID 206 GROUP_ID 21 GROUP_ID 217 GROUP_ID 22 GROUP_ID 238 GROUP_ID 245 GROUP_ID 249 GROUP_ID 25 GROUP_ID 259 name: EVENT_COMPLETED key value --- ----- GROUP_ID 15 GROUP_ID 18 GROUP_ID 204 GROUP_ID 206 GROUP_ID 21 GROUP_ID 234 GROUP_ID 22 GROUP_ID 238 GROUP_ID 245 GROUP_ID 265 GROUP_ID 13 GROUP_ID 259 

The tag values are retrieved for all the measurements in the database.

But when i tried to fetch the tags specific to the measurement

EVENT_LIVE, by executing the below query, i am not seeing any results.

what can be the issue with the below query ?

show tag values with key=GROUP_ID where "name" ='PGM_LIVE' 
1
  • The influxDB version that i am using is 1.6.0 Commented Oct 21, 2018 at 14:28

2 Answers 2

13

Q: Why is my query showing data from all measurements?

A: You'll have to be explicit. That is, you need to tell your query where to look for the things, otherwise it will try its best to find the data you want from all measurements.

To narrow down the search space to just a measurement, you can use the from clause. Basically just like what you did in your SELECT statement.

e.g. show tag values from EVENT_LIVE with key=GROUP_ID;

See https://docs.influxdata.com/influxdb/v1.6/query_language/data_exploration/#from-clause

Sign up to request clarification or add additional context in comments.

1 Comment

is this also possible with fields?
1

Hi Siva following should work ..

show tag values from pgm_live with key=GROUP_ID

or

show tag values from event_live with key=GROUP_ID

best regards , Marc V. (Mata)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.