Hello All,
I am using Grafana v8.4.10 on a Linux instance.
I have an InfluxDB datasource configured with query type as InfluxQL.
I have a list of devices for which timeseries property data is captured in influxDB.
So the property data is stored into separate measurement table for each device.
I want to display the data for all the devices at the same time in a timeseries chart.
So I have all the device list queried and stored into a variable. And to show the property data for all the devices in the chart, I am using influxDB query as below.
SELECT “time”, “propertyName” FROM /($Variable)/
This will return the property data for all the measurements (i.e. devices) together and display on the chart.
But the problem I have is the chart legend is showing each plotting in graph in format as below.
Device1.propertyName
Device2.propertyName
Device3.propertyName and so on.
Whereas I want to display it as
Device1
Device2
Device3 and so on.
How can I achieve custom column name in the query I am using to show only the measurement name as legend or column name instead of measurement.propertyName which is appearing currently.
I am hoping we can achieve this with regex, but I am not sure how to do this.
Or if there is any other way possible.
Please reach out if you have any inputs.
Thanks in advance
Bhushan