DogLeash is a command line tool to import and export data from Datadog.
Maybe other funcion will be added.
To build this tool from source code, Go 1.11 is required.
export GO111MODULE=on && go get github.com/tani-yu/dogleash
Go to Datadog API settings and generate an API key and Application key.
Create a minimal ~/.dogrc
that looks like this:
[Connection]
apikey = YOUR_API_KEY
appkey = YOUR_APP_KEY
You can skip this step if you already use dogshell and have ~/.dogrc
file.
You can also use environment variables DATADOG_API_KEY
and DATADOG_APP_KEY
.
In this case, the credential read from .dogrc
file will be overwritten by the environment variables.
DogLeash supports shell command completions for Bash and Zsh.
If you are using macOS and Bash, you need to install bash-completion
using Homebrew.
## If running Bash 3.2 included with macOS
brew install bash-completion
## or, if running Bash 4.1+
brew install bash-completion@2
Follow the "caveats" section of brew's output to add the appropriate bash completion path to your local ~/.bashrc
.
If you have installed DogLeash manually, you need add the completion settings to bash completion directory.
dogleash completion bash > $(brew --prefix)/etc/bash_completion.d/dogleash
If you are using Zsh, you can enable autocompletion adding the following codes to ~/.zshrc
.
if [ $commands[dogleash] ]; then
source <(dogleash completion zsh)
fi
Get all monitor information at standard output. (JSON format)
dogleash monitor show_all
Display all monitor information in JSON format.
dogleash monitor show_all
Export all monitor information in JSON File. If you want to specify path, you can use d
option.
dogleash monitor export
dogleash monitor export -d /tmp/
Import monitor information from JSON file.
dogleash monitor import -i JSON_FILE_PATH
See the contributing guidelines.