- What Grafana version and what operating system are you using?
Grafana 9.1.3 on Oracle Entrerprise Linux 8 -
What are you trying to achieve?
I am trying to select data in a specific field to be used in a variable for a dashboard -
How are you trying to achieve it?
Using Flux - What happened?
No data is displayed - What did you expect to happen?
Data to be displayed in the selected field - Can you copy/paste the configuration(s) that you are having problems with?
yes - Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
no errors. Is is not displaying any data. - Did you follow any online instructions? If so, what is the URL?
I have tried numerous websites.
I have a bucket that receives data from about 2500 hosts. Our hostnames contains a group name. An example would be:
host-webservers-[aws_instance_id].domain.com
host-mysqlservers-[aws_instance_id].domain.com
host-reverseproxy-[aws_instance_id].domain.com
host-postgresql[aws_instance_id].domain.com
We have multiple of each of these types of hosts to the total of about 2500 hosts.
We use telegraf to collect and send data to influxdb.
I have set up a dashboard with various telemetry and other data and am using 3 variables to get select which hosts to look at.
The 1st variable is called bucket as we have various buckets for various AWS regions. So a bucket name will be something like us-east-1.
The second variable I am using is called e_group_name. This varialbe is supposed to list all hostnames and then extract the bit after host- and before the -[aws_instance_id].domain.com. I use this query for that:
import “influxdata/influxdb/schema”
schema.tagValues(
bucket: “${BUCKET}”,
tag: “host”,
predicate: (r) => true,
start: v.timeRangeStart,
stop:v.timeRangeStop
)
selecting the middle bit with this regex:
/.-e-(.)-.*/
This somewhat works. I have found that if i run this query on the CLI using influx query, the host names looks like this:
host-webservers-0deb191d110a7aef0.domain.com
host-webservers-0df933d7bec171e77.domain.com
host-webservers-0e4084661de823ad6.domain.com
host-mysqlservers-0ea0e00928a3a637f.domain.com
host-mysqlservers-0f1fc1e7faa79467e.domain.com
host-webservers-071904f6d18c00ef5.domain…
host-webservers-0a0a59429c1854bfe.domain…
host-mysqlservers-0c4ea0357f553388c.domain…
The query stops listing any further data after the 1st ocurrence of a host that contains the 3 dots. So my query only returns the 1st 5 records in thois sample query.
The third variable is called e_name and uses the following:
import “influxdata/influxdb/schema”
schema.tagValues(
bucket: “${BUCKET}”,
tag: “host”,
predicate: (r) => true,
start: v.timeRangeStart,
stop:v.timeRangeStop
)
selecting the middle bit with this regex:
/csm-e-${e_group_name}.*/
This then further impacts on the 3rd variable that is supposed to return the full hostname, but because of the 3 dots, it is not displaying those hosts and as with the first query, only the 1st 5 records.
I have now been struggling with this for more than 2 weeks and I just cant get the flux query to give me the data i need for the variables as specified above.
Is someone please able to help me with this?
Thank you