tenet testuser1
tenet testuser1

Reputation: 109

How to update the URLs in Data Links in Grafana

I have about 50 reports in Grafana and many of them have Datalinks with URLs and variables. I would like to move the reports to another domain which means all these URLs need to be updated with the "domain portion" of the new domain.

Is there a way to programmatically do it?

I find it tedious to do it report by report. As there are way too many.

Please advise.

Upvotes: 0

Views: 613

Answers (2)

Gee
Gee

Reputation: 15

Thanks @Jens Baitinger

Your tip helped. Though I did not try the API yet, (which I will). I has exported the report to migrate to the new server and discovered the data link urls are present there. I was able to do an update.

So now I have options.

Thank You

Upvotes: 0

Jens Baitinger
Jens Baitinger

Reputation: 2365

You can use the Grafana REST API to access the json definition of your dashboards.

The rest is 'just' iterating over all dashboards, receiving the code, search and replace and posting the changed dashboard code back to Grafana

Upvotes: 1

Related Questions