Is there a way to list all dashbaords that use a datasource in Grafana?

We are making changes to some of our datasources and are looking for a way to find all dashboards using these datasources. Is there a way to list all dashbaords using a datasource?

1 Like

I don’t think there’s an “off-the-shelf” way. You’d probably need to iterate through each of the dashboard definitions and check whether any panels (or template variables) use that datasource. To do that you could either:
a) Write a script that pulls each dashboard’s JSON definition via the API and does a text search for the datasource name. (probably the “right” way to do this, but requires some effort)
b) Run a SQL query to search the Grafana database. You’d need to search through the data column of the dashboard table. (probably the quicker way, provided you have direct access to the DB)

If you’re using the (default) SQLite Grafana database, you could also open up grafana.db in a visual explorer (like and quickly filter the dashboard definitions with that.


Dear Nayana,


On, we regularly are facing the same requirements.

As pointed out by @svetb, Grafana itself doesn’t offer such a feature, but we implemented GitHub - panodata/grafana-wtf: Grep through all Grafana entities in the spirit of git-wtf. the other day, which exactly does


We already wrote some more about this at:

We will be happy to hear about whether this was helpful to you. Please let us know if you need further assistance with grafana-wtf.

With kind regards,


This looks useful, we will give this a try and see how it works for us. WIll get back here to let you know how it went, Thanks

1 Like

This tool is great and has helped me a lot

1 Like

Hi again,

Coming from a discussion with @chenlujjj and @jangaraj at How to find out unused datasources?, we recently added a few new features to grafana-wtf. One of them is explore dashboards, which might fit very well in this context.

To make the story short, those two command invocations, combined with jq, can aid in helping to find dashboards using specific data sources, either by name or by type.

# 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" )'

With kind regards,