datadog-logs
Search for logs in the Datadog service.
datadog-logs [profile=PROFILE] [duration=NUM{mon|w|d|h|m|s}] [from=yyyyMMddHHmmss] [to=yyyyMMddHHmmss] [query=QUERY] [sort=SORT]
- profile=PROFILE
- Connect profile code of Datadog
- duration=NUM{mon|w|d|h|m|s}
- Scan only recent data. You should use s(second), m(minute), h(hour), d(day), mon(month) time unit. For example,
10s
means data from 10 seconds earlier. - from=yyyyMMddHHmmss
- Start time of range. yyyyMMddHHmmss format. If you omit time part, it will be padded by zero.
- to=yyyyMMddHHmmss
- End time of range. yyyyMMddHHmmss format. If you omit time part, it will be padded by zero.
- query=QUERY
- Datadog query string supports full-text search, attribute filters (@attribute:value), wildcards (,?), numeric comparisons (@response_time:>100), tag searches (env:prod), boolean operators (AND, OR, NOT), and ranges (@status:[400 TO 499]). Use quotes for exact matches. Default is '' (all logs). Example: service:web AND @status_code:>=400
- sort=SORT
- Sort order. default is '-timestamp'
Output Fields
Field | Type | Name | Description |
---|---|---|---|
_time | Date | Time | Log timestamp |
profile | String | Connect profile | Datadog connect profile code |
id | String | Log ID | e.g. AwAAAZczaSmqtsPVlwAAABhBWmN6Y... |
type | String | Type | e.g. log |
service | String | Service | e.g. store |
host | String | Host | e.g. i-089f591fd1d28b9b5 |
attributes | Map | Attributes | Key-value pairs |
msg | String | Message | Log message |
status | String | Status | e.g. info, error, warn |
tags | List | Tags | e.g. datadog.index:main, source:java |