Skip to content

Instantly share code, notes, and snippets.

@rvanbutselaar
Created January 23, 2020 10:26
Show Gist options
  • Save rvanbutselaar/de2ebb87ffc513051d2ed2fb8fa8a75f to your computer and use it in GitHub Desktop.
Save rvanbutselaar/de2ebb87ffc513051d2ed2fb8fa8a75f to your computer and use it in GitHub Desktop.
HOST="http://localhost:3001"
for dash in $(curl -s -H "X-Forwarded-User: admin" $HOST/api/search\?query | jq -r '.[]'| jq -r '.uid'); do
echo $dash;
OUTPUT=$(curl -s -H "X-Forwarded-User: admin" $HOST/api/dashboards/uid/$dash);
TITLE=$(echo -E $OUTPUT | jq -r '.dashboard.title'| grep -v null)
echo $TITLE
echo -E $OUTPUT | jq | tee "$TITLE.json"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment