query_logs_df: Log files quering - df.

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

View source: R/query_logs.R

Description

query_logs_df() sends a httr POST request via Datadog-API and returns a data.frame().

Usage

1
2
query_logs_df(query, time_from = "now -1h", time_to = "now", ...,
              include_meta_data = FALSE)

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.

include_meta_data

should Datadog query metadata be included?

Details

Only the query result will be returned, for metadata and request headers use query_logs_httr. 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.

In case no results are found or invalid parameters are used for the request, an empty data.frame() will be returned.

For more details about the httr response see httr-package.

Value

data.frame() with the result data or an empty data.frame().

Author(s)

Benjamin Holzknecht

See Also

query_logs_httr, set_api_top_level_domains, send_json

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 

query_logs_df("POST 200", time_from = "now -1d")

# get all from last hour
query_logs_df("POST 200", time_from = "now -1d", limit = 30)

# with ISO 8601 date-time format
query_logs_df("POST 200", time_from = "2020-01-18T13:00Z", limit = 1)

# limtit = 1000 --> maximum per response
query_logs_df("POST 200", time_from = "now -1d", limit = 1000)



## End(Not run)

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