Skip to content

Commit

Permalink
Add two more examples about using explore dashboards with jq
Browse files Browse the repository at this point in the history
- Display all dashboards which use a specific data source, by name.
- Display all dashboards using data sources with a specific type.
  • Loading branch information
amotl committed Dec 17, 2021
1 parent 5f86eec commit 8a7210d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions grafana_wtf/commands.py
Expand Up @@ -87,6 +87,12 @@ def run():
# Display only dashboards which have missing data sources, along with their names.
grafana-wtf explore dashboards --format=json | jq '.[] | select( .datasources_missing ) | .dashboard + {ds_missing: .datasources_missing[] | [.name]}'
# Display all dashboards which use a specific data source, filtered by data source name.
grafana-wtf explore dashboards --format=json | jq 'select( .[] | .datasources | .[].name=="<datasource_name>" )'
# Display all dashboards using data sources with a specific type. Here: InfluxDB.
grafana-wtf explore dashboards --format=json | jq 'select( .[] | .datasources | .[].type=="influxdb" )'
Find dashboards and data sources:
Expand Down

0 comments on commit 8a7210d

Please sign in to comment.