Skip to content

Instantly share code, notes, and snippets.

@miketheman
Last active May 22, 2017 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save miketheman/d74075523ba623dd18b0 to your computer and use it in GitHub Desktop.
Save miketheman/d74075523ba623dd18b0 to your computer and use it in GitHub Desktop.
Retrieve metadata about systems from Datadog
# Ensure you have `jq` installed - http://stedolan.github.io/jq/
$ brew install jq
...
/usr/local/Cellar/jq/1.4: 15 files, 748K, built in 9 seconds
# Grab your API_KEY and create an APPLICATION_KEY from https://app.datadoghq.com/account/settings#api
$ export API_KEY=aaabbbccc
$ export APPLICATION_KEY=111222333
$ curl -s "https://app.datadoghq.com/reports/v1/overview?with_meta=true&api_key=$API_KEY&application_key=$APPLICATION_KEY" \
| jq -r '.rows[] | select(.meta.platform == "linux2")
| select(.meta.agent_version | startswith("5.") | not)
| [.name, .meta.agent_version] | @csv' | sort
"centos-6.5-agent-test","4.4.0"
"docker-test","4.4.0"
"i-aaaabbbb","4.0.1"
"i-ccccdddd","4.0.1"
@vagelim
Copy link

vagelim commented May 22, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment