fix query and allow for setting text and value of servername template var

This commit is contained in:
m0duspwnens
2021-07-23 16:52:07 -04:00
parent 5a06f0dce9
commit e9d90644fd
2 changed files with 6 additions and 4 deletions

View File

@@ -29,7 +29,9 @@ grafana:
title: 'Security Onion Grid Overview'
templating:
list:
servername: {}
servername:
text: All
value: "$__all"
role:
allValue: true
multi: true

View File

@@ -1,15 +1,15 @@
{% if DASHBOARD == 'overview' %}
{% set query = "show tag values with key=\\\"host\\\" WHERE (\\\"role\\\" =~ /^$role$/)" %}
{% else %}
{% set query = "show tag values with key=\\\"host\\\" WHERE (\\\"role\\\" = DASHBOARD ')" %}
{% set query = "show tag values with key=\\\"host\\\" WHERE (\\\"role\\\" = '" ~ DASHBOARD ~ "' )" %}
{% endif %}
{
"allValue": null,
"current": {
"selected": true,
"tags": [],
"text": [],
"value": []
"text": [{{ TEMPLATES.servername.get('text', '')| json }}],
"value": [{{ TEMPLATES.servername.get('value', '')| json }}]
},
"datasource": "InfluxDB",
"definition": "{{ query }}",