![]() |
VOOZH | about |
Logs are essential for security investigations, aiding in threat detection, compliance tracking, and security monitoring. Log Management systems correlate logs with observability data for rapid root cause detection. Log management also enables efficient troubleshooting, issue resolution, and security audits.
Once log management is enabled for your organization, you can create a logs monitor to alert you when a specified log type exceeds a user-defined threshold over a given period of time. The logs monitor only evaluates indexed logs.
Note: Log monitors have a maximum rolling time window of 2 days.
To create a log monitor in Datadog, use the main navigation: Monitors > New Monitor > Logs.
As you define the search query, the graph above the search fields updates.
Construct a search query using the same logic as a Log Explorer search. Note that Flex Tier logs, which can be shown in Log Explorer, are not supported for monitors. Only Standard Tier logs are supported.
Choose to monitor over a log count, facet, an attribute, or measure:
user.email, the unique value count is the number of unique user emails. Any attribute can be used in a monitor, but only facets are shown in the autocompletion.min, avg, sum, median, pc75, pc90, pc95, pc98, pc99, or max).Group logs by multiple dimensions (optional):
Datadog aggregates all logs matching the query into groups based on the values of tags, attributes, and up to four facets. When there are multiple dimensions, the top values are determined according to the first dimension, then according to the second dimension within the top values of the first dimension, and so on up to the last dimension. Dimensions limit depends on the total number of dimension:
If there are multiple queries or formulas defined in a log monitor, you can select the number of top or bottom values for each dimension.
The total limit, irrespective of the number of facets, is 1000 top values. If you increase this above 1000, Datadog adjusts the top values for the other dimensions to ensure the number of the resulting combinations is less than 1000. The default top values for every group-by is 10, with the exception of the fourth, which defaults to 5 top values.
As an example, a Log Monitor with four groupings on the search query could have:
Configure the alerting grouping strategy (optional):
system.disk.in_use by device to receive a separate alert for each device that is running out of space.Trigger when the query meets one of the following conditions compared to a threshold value:
aboveabove or equal tobelowbelow or equal toequal tonot equal toNO DATA is a state given when no logs match the monitor query during the timeframe.
To receive a notification when all groups matching a specific query have stopped sending logs, set the condition to below 1. This notifies when no logs match the monitor query in a given timeframe across all aggregate groups.
When splitting the monitor by any dimension (tag or facet) and using a below condition, the alert is triggered if and only if there are logs for a given group, and the count is below the threshold—or if there are no logs for all of the groups.
Examples:
backend:For detailed instructions on the advanced alert options (evaluation delay, new group delay, etc.), see the Monitor configuration page.
For detailed instructions on the Configure notifications and automations section, see the Notifications page.
When a logs monitor is triggered, samples or values can be added to the notification message. Logs without a message are not included in samples. In order to add the content of a log attribute to the monitor’s message, use Log monitor template variables directly in the monitor’s message body.
| Monitor Setup | Can be added to notification message |
|---|---|
| Ungrouped Simple-Alert Log count | Up to 10 log samples. |
| Grouped Simple-Alert Log count | Up to 10 facet or measure values. |
| Grouped Multi Alert Log count | Up to 10 log samples. |
| Ungrouped Simple-Alert measure | Up to 10 log samples. |
| Grouped Simple-Alert measure | Up to 10 facet or measure values. |
| Grouped Multi Alert Log measure | Up to 10 facet or measure values. |
These are available for notifications sent to Slack, Jira, webhooks, Microsoft Teams, Pagerduty, and email. Note: Samples are not displayed for recovery notifications.
To disable log samples, uncheck the box at the bottom of the Configure notification & automations section. The text next to the box is based on your monitor’s grouping (as stated above).
Include a table of the top 10 breaching values:
Include a sample of 10 logs in the alert notification:
Additional helpful documentation, links, and articles:
| |