Closed sendqueery closed 4 years ago
Whoops, I should probably link to the API doc: https://docs.datadoghq.com/api/?lang=bash#get-a-list-of-logs
@sendqueery Thank you for the PR. We have a few folks at Datadog reviewing.
@bkabrda I also changed the naming of QueryTime
and Attributes
to keep things consistent.
The datadog web interface only allows a user to export up to 5k log lines at a time. Sometimes, you just need more than that. This PR adds functionality that allows a user to hit the
logs-queries/list
API and retrieve any number of logs, along with the corresponding tags and attributes for each.As this particular API only returns up to 1000 lines at a time,
GetLogsListPages()
handles the pagination and can retrieve all results.This has appropriate tests and mock JSON response data, and has been successfully tested for use in a small scraper tool I'm writing for internal use at work.