query_logs_httr: Log files quering - httr.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/query_logs.R

Description

query_logs_httr() Send a httr POST request Datadog-API.

Usage

1
query_logs_httr(query, time_from = "now -1h", time_to = "now", ...)

Arguments

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. now -10m, now - 1h, now - 1d.

time_to

the end point as ISO-8601 string, Unix timestamp or in relative time eg. now -10m, now - 1h, now - 1d.

...

optional parameters.

Details

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.

Value

httr request including headers and body.

Author(s)

Benjamin Holzknecht

See Also

query_logs_df, set_api_top_level_domains, send_json

Examples

 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)

holzben/dogR documentation built on Feb. 21, 2020, 10:25 a.m.