Skip to content

Instantly share code, notes, and snippets.

@GauntletWizard
Created April 13, 2018 22:59
Show Gist options
  • Save GauntletWizard/6df00c4e22995230355e5be84747d82a to your computer and use it in GitHub Desktop.
Save GauntletWizard/6df00c4e22995230355e5be84747d82a to your computer and use it in GitHub Desktop.
Saves honeycomb boards for version control purposes
#!/bin/bash
# honeysave.sh - Saves honeycomb boards for version control purposes
WRITEKEY=""
honeycurl() {
curl -H "X-Honeycomb-Team: ${WRITEKEY}" https://api.honeycomb.io/1/boards/$*
}
save() {
BOARDS=$(honeycurl | jq -r '.[].id')
for BOARD in ${BOARDS}
do
TMPFILE="$(mktemp)"
honeycurl $BOARD > "$TMPFILE"
echo "$TMPFILE"
BOARDNAME="$(jq -r .name "$TMPFILE")"
mv "$TMPFILE" "boards/${BOARDNAME}.json"
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment