- What Grafana version and what operating system are you using?
10.4.2 - What are you trying to achieve?
I’m trying to use variables to filter my data - How are you trying to achieve it?
I’m using query variables with ElasticSearch data. My query is:
{"find": "terms", "field": "area", "size": 1000}
- What happened?
When i run the query it shows the areas correctly. But when I save, it tells me that this variable is not being used in my dashboard. I have a full built dashboard that uses the variable family in tables, graphs, timelines and gauges so I don’t understand why it says that. - What did you expect to happen?
I expected to select one of the production areas and all the dashboard gets filtered by that area, but it doesn’t do anything. - Can you copy/paste the configuration(s) that you are having problems with?
This is the query of the variable:
{"find": "terms", "field": "area", "size": 1000}
This is the JSON query of one of my panels:
{
"datasource": {
"type": "elasticsearch",
"uid": "edivx6uxe1tz4a"
},
"description": "Shows the total alarms in Body 1 in the selected time range",
"fieldConfig": {
"defaults": {
"mappings": [],
"thresholds": {
"mode": "percentage",
"steps": [
{
"color": "blue",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 2,
"x": 0,
"y": 1
},
"id": 10,
"options": {
"reduceOptions": {
"values": true,
"calcs": [],
"fields": ""
},
"orientation": "auto",
"showThresholdLabels": false,
"showThresholdMarkers": true,
"sizing": "auto",
"minVizWidth": 75,
"minVizHeight": 75
},
"pluginVersion": "10.4.2",
"targets": [
{
"alias": "",
"bucketAggs": [
{
"field": "area",
"id": "2",
"settings": {
"min_doc_count": "1",
"order": "desc",
"orderBy": "_term",
"size": "10"
},
"type": "terms"
}
],
"datasource": {
"type": "elasticsearch",
"uid": "edivx6uxe1tz4a"
},
"metrics": [
{
"id": "1",
"type": "count"
}
],
"query": "area:\"Body 1\"",
"refId": "A",
"timeField": "date"
}
],
"title": "Body 1",
"type": "gauge"
}
- Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
It says "This variable is not referenced by any variable or dashboard. - Did you follow any online instructions? If so, what is the URL?
Yes, i followed the official YT channel guide and some documentation.