Description Usage Arguments Details Value Author(s) See Also Examples
query_logs_httr()
Send a httr POST request Datadog-API.
1 | query_logs_httr(query, time_from = "now -1h", time_to = "now", ...)
|
query |
the search query using the Datadog search syntax. |
time_from |
the starting point as ISO-8601 string, Unix timestamp or in relative time eg. |
time_to |
the end point as ISO-8601 string, Unix timestamp or in relative time eg. |
... |
optional parameters. |
More details on all optional parameters can be found at the Datadog-API description: Datadog-API
For the request the addresses specified with set_api_top_level_domains
are used.
By default maximum 10 logs will be returned per response, higher numbers can be set via the limit
parameter with
a maximum of limit = 1000
.
httr request including headers and body.
Benjamin Holzknecht
query_logs_df
, set_api_top_level_domains
, send_json
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## Not run:
query_logs_httr("POST 200", time_from = "now -1d")
# get all from last hour
query_logs_httr("POST 200", time_from = "now -1d", limit = 30)
# limtit = 1000 --> maximum per response
query_logs_httr("POST 200", time_from = "now -1d", limit = 1000)
# to get the same result as query_logs_df
response <- query_logs_httr("POST 200", time_from = "now -1d", limit = 1000)
response <- jsonlite::fromJSON(httr::content(response, type = "text"), flatten = TRUE)
# cast to df
as.data.frame(response$logs)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.