Skip to content

Instantly share code, notes, and snippets.

View mfaridi1394's full-sized avatar

Mostafa Faridi mfaridi1394

View GitHub Profile
@mfaridi1394
mfaridi1394 / grafana-dashboard-exporter
Created January 28, 2023 06:41 — forked from crisidev/grafana-dashboard-exporter
Command to export all grafana 2 dashboard to JSON using curl
KEY=XXXXXXXXXXXX
HOST="https://metrics.crisidev.org"
mkdir -p dashboards && for dash in $(curl -k -H "Authorization: Bearer $KEY" $HOST/api/search\?query\=\& |tr ']' '\n' |cut -d "," -f 5 |grep slug |cut -d\" -f 4); do
curl -k -H "Authorization: Bearer $KEY" $HOST/api/dashboards/db/$dash > dashboards/$dash.json
done