A Node.js utility for retrieving Datadog logs. In a sense, a small implementation of Collect multiple logs with Pagination.
- Install Node.js.
- Set the environment variables
DD_API_KEY
,DD_APP_KEY
andDD_SITE_URL
according to your account details.
- Install dependencies
npm install
.
cd datadog-log-downloader
query="*" from="now - 15m" to="now" npm start
or, if you want to place them in a file, you can:
query="*" from="now - 15m" to="now" npm start > log_dump.log
- This script interacts with Datadog's "Get a list all of logs" endpoint.
- The parameters above (
query
,from
andto
) accept the same kind of arguments as in Datadog's documentation. This gives you some flexibility in terms of how you'd like to express your timestamps.