Instantly share code, notes, and snippets.

Embed
What would you like to do?
Export/Import datadog dashboards
dash_id=xxxx
api_key=xxx
app_key=xxx
# 1. export
curl -X GET "https://app.datadoghq.com/api/v1/dash/${dash_id}?api_key=${api_key}&application_key=${app_key}" > dash.json
# 2. edit dash.json
move "graphs", "title", "description" up one level in the json hierarchy, from being beneath "dash" to being at the same level
# 3. import
curl -X POST -H "Content-type: application/json" -d @dash.json "https://app.datadoghq.com/api/v1/dash?api_key=${api_key}&application_key=${app_key}"
@cw-tomita

This comment has been minimized.

cw-tomita commented Mar 22, 2018

Great tips! This was really helpful.

FYI, I found another way to export / import dashboards.
https://github.com/ouyi/dashjson
Maybe dashjson is easier but some fields could be missing and might need some patches when you have complicated dashboards.
ouyi/dashjson#1

@mleuthold

This comment has been minimized.

mleuthold commented Aug 20, 2018

In case you want to export a dashboard, where "graphs", "title" and "description" is already on the first level, use this command:

curl -X GET "https://app.datadoghq.com/api/v1/dash/${dash_id}?api_key=${api_key}&application_key=${app_key}" | jq '.dash' > dash.json

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