The Datadog CLI lets you query logs from your terminal. If you're querying aggregated logs, this also gives you the option to disaggregate them into individual log lines.
Copy git clone git@github.com:nimbushq/dd-cli.git
cd dd-cli
yarn && yarn build
npm link
Copy nimbus logs
Search across dd logs. The following environmental variables need to be set in
order to run this command: DD_SITE, DD_API_KEY, DD_APP_KEY
Options:
--version Show version number [boolean]
--help Show help [boolean]
-q, --query dd log query [string] [required]
-f, --from time in the following format:
2024-02-14T11:35:00-08:00
[string] [required]
--to, --t, desc: "time in the
following format:
2024-02-14T11:35:00-08:00" [string] [required]
-i, --indexes log indexes to search
[array] [default: [ "main" ]]
-d, --disaggregate disaggregate aggregated logs
[boolean]
Copy # regular query
env DD_SITE="***" DD_API_KEY="***" DD_APP_KEY="***" dd-cli logs -q "service:elb " -f "2024-02-14T11:35:00-08:00" -t "2024-02-14T11:38:00-08:00"
# query with log disaggregation
env DD_SITE="***" DD_API_KEY="***" DD_APP_KEY="***" dd-cli logs -q "service:elb " -f "2024-02-14T11:35:00-08:00" -t "2024-02-14T11:38:00-08:00" -d