-
-
Save stfclv/53eca57d2f7d2fbdec3345cd3bf0761e to your computer and use it in GitHub Desktop.
Command to export all grafana 3 dashboard to JSON using curl & jq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
KEY=XXXXXXXXXXXX | |
HOST="https://metrics.crisidev.org" | |
mkdir -p dashboards && for dash in $(curl -k -H "Authorization: Bearer $KEY" $HOST/api/search | jq -r '.[].uri|ltrimstr("db/")'); do | |
curl -k -H "Authorization: Bearer $KEY" $HOST/api/dashboards/db/$dash | jq '.dashboard' > dashboards/$dash.json | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
using this one which export the server name, tree structure from Grafana where the dasboard is saved + version and uid: