This use case guides you through setting up log monitoring using OneAgent to automatically discover and ingest logs from your hosts. You'll learn how to configure log sources, create ingest rules, and apply data filtering and masking to ensure you collect the relevant logs while protecting sensitive information.
OneAgent provides automatic log discovery for many common log sources, and you can also add custom sources and fine-tune collection rules to meet your specific monitoring requirements.
This article is intended for Dynatrace administrators setting up log monitoring with OneAgent.
You are a Dynatrace admin who wants to track whether there are system errors on the hosts you monitor.
You need to have OneAgent installed on your host.
Check the Log Analytics feature status. Log monitoring is enabled by default. If the configuration was changed, ensure the following:
In your Dynatrace environment: OneAgent settings.
This is not a log ingest configuration but a feature enablement option. It's enabled by default, so you don't need to change it in most cases.
On the OneAgent instance.
The following are the best practices to ingest and configure log sources at scale:
required
Hosts classic.optional
Follow the steps below to add a custom log source:
See Configure custom log source to add log sources that have not been autodetected.
It's recommended to add custom log sources if auto-detection adjustment is not possible.
required
Define log ingest rules with matchers to control which logs are collected and sent to Dynatrace storage. Go to Log ingest rules to learn more.
Follow the steps below to configure your log ingest rule:
All the logs that are ingested by the ingest rules consume license for ingestion
optional
Create ingest rules with matchers for log.level or content attributes as described in Log ingest rules. This helps reduce data volume and focus on relevant logs.
For example, you can:
optional
Configure rules to mask sensitive log data such as user names, email addresses, or URL parameters. For more information about how to select the data that needs to be protected, and how to apply masking rules, see Sensitive data masking in OneAgent.
optional
Configure rules to mask sensitive data during ingest. This provides enhanced data protection because the masked data is not stored. For more information, see Log processing for sensitive data masking, or review all available Methods of masking sensitive data.
optional
Go to Settings > Collect and capture > Log monitoring > Advanced log settings. For detailed configuration guidance, see the Advanced log settings guide
These settings are typically needed when: