Loading...
Loading...
Log queries, filtering, pattern analysis, and log correlation. Search and analyze application and infrastructure logs.
npx skill4agent add dynatrace/dynatrace-for-ai dt-obs-logsfrom:now() - <duration>matchesPhrase()contains()fetch logs, from:now() - 1h
| filter status == "ERROR"
| fields timestamp, content, process_group = dt.process_group.detected_name
| sort timestamp desc
| limit 100fetch logs, from:now() - 2h
| filter in(status, {"ERROR", "FATAL", "WARN"})
| summarize count(), by: {dt.process_group.id, dt.process_group.detected_name}
| fieldsAdd process_group = dt.process_group.detected_name
| sort `count()` descfetch logs, from:now() - 2h
| filter status == "ERROR"
| fieldsAdd
has_exception = if(matchesPhrase(content, "exception"), true, else: false),
has_timeout = if(matchesPhrase(content, "timeout"), true, else: false)
| summarize
count(),
exception_count = countIf(has_exception == true),
timeout_count = countIf(has_timeout == true),
by: {process_group = dt.process_group.detected_name}filter status == "ERROR"in(status, "ERROR", "FATAL", "WARN")contains(content, "keyword")matchesPhrase(content, "exact phrase")dt.process_group.detected_namefilter process_group == "service-name"count()countIf(condition)by: {dimension}bin(timestamp, 5m)fields timestamp, content, statusfieldsAdd name = expressionif(condition, true_value, else: false_value)fetch logs, from:now() - 1h
| filter contains(content, "database")
| fields timestamp, content, statusfetch logs, from:now() - 1h
| filter matchesPhrase(content, "connection timeout")
| fields timestamp, content, process_group = dt.process_group.detected_namefetch logs, from:now() - 2h
| summarize
total_logs = count(),
error_logs = countIf(status == "ERROR"),
by: {time_bucket = bin(timestamp, 5m)}
| fieldsAdd error_rate = (error_logs * 100.0) / total_logs
| sort time_bucket ascfetch logs, from:now() - 24h
| filter status == "ERROR"
| summarize error_count = count(), by: {content}
| sort error_count desc
| limit 20fetch logs, from:now() - 1h
| fieldsAdd process_group = dt.process_group.detected_name
| filter process_group == "payment-service"
| filter status == "ERROR"
| fields timestamp, content, status
| sort timestamp descparsefetch logs, from:now() - 1h
| filter status == "ERROR"
| parse content, "JSON:log"
| fieldsAdd level = log[level], message = log[msg], error = log[error]
| fields timestamp, level, message, error
| sort timestamp desc
| limit 50fetch logs, from:now() - 4h
| filter status == "ERROR"
| parse content, "JSON:log"
| fieldsAdd message = log[msg]
| summarize error_count = count(), by: {message}
| sort error_count desc
| limit 20parse content, "JSON:log"loglog[key]contains()parsecontentfrom:now() - <duration>contains()matchesPhrase()| limit 100dt.process_group.detected_namegetNodeName()bin(timestamp, 5m)dt.process_group.idbin()matchesPhrase()summarizematchesPhrase