Skip to content

Instantly share code, notes, and snippets.

@jderrett
Last active August 29, 2015 14:16
Show Gist options
  • Save jderrett/ff098dd93fb5baad6b6c to your computer and use it in GitHub Desktop.
Save jderrett/ff098dd93fb5baad6b6c to your computer and use it in GitHub Desktop.
Grab last N hours from Librato API using httpie and jq
HOURS_BACK=3
http GET https://metrics-api.librato.com/v1/metrics \
compose='s("AWS.EC2.CPUUtilization", "*", {period: "3600"})' \
resolution=3600 \
start_time=$(echo "$(date +'%s')-$HOURS_BACK*3600" | bc) \
| jq '[.measurements[].series[]]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment