Log Monitoring can read and analyze:
System, Security, and Application logs are automatically discovered on hosts. Other custom event-log format logs can be added manually on the environment level. The timestamp is sourced from an event's attribute, Event.System.TimeCreated.<xmlattr>.SystemTime.
Any plain-text log file is valid as long as it is encoded in UTF-8 or UTF-16. The timestamp is detected automatically when it is present, according to the rules described in Supported timestamp formats (Logs Classic). It is also possible to configure your timestamp. If no timestamp is present, the log format is still valid. In such case, each line that doesn't start with a whitespace is treated as the beginning of a new log record, and is automatically assigned a timestamp that is the time of reading a log record by OneAgent.
There is no specific support for JSON. It is treated as text.
Any log entry with an unrecognized timestamp will be adjusted with the current timestamp to allow the log entry to be processed.
The proper timestamp format consists of both date and time. The list below covers possible time formats, which need to be paired with the allowed date formats listed in the next section:
12:23:34.12312:23:34.123GMT+010012:23:34.123 GMT+01000:00:00 GMT0:00:00 GMT+010000:00:0012:13:01+010012:13:02.12312:13:03.123123+010012:13:02,12312:13:03,123123+010012:13:04GMT12:13:05GMT+010012:13:06GMT+0112:13:09+010012:13:10+0112:13:12+020012:13:13.123pm12:13:14.123 AM12:13:15.123PM+0112:13:16.123 AM+0212:13:17CEST12:13:18 CET00:13:19
Below are the date formats that need to be paired with the time formats listed in the previous section:
2018-04-06 09:54:04.839 UTC2018-04-06 11:01:19,6252018/04/06 11:06:23 UTCApr 6 12:23:52Apr-6 13:35:57.621
OneAgent version 1.327+ supports logs in JSON format.
Logs can be provided as JSON objects or arrays. Newline characters can be used to create multi-line JSON objects.
Headers and non-JSON prefixes are allowed. These are parsed as plain text.
OneAgent accepts a header at the beginning of the file, which is parsed as plain text..
OneAgent extracts the timestamp and loglevel attributes from the appropriate fields within the JSON object. This is the same behavior as with the Log ingestion API. Go to Log Monitoring API - POST ingest logs to see the list of supported keys.
Additionally, it extracts the attributes from a non-JSON prefix, if present. In such a case, the values from the prefix take priority.
If there are multiple timestamp or loglevel fields within a single JSON object, only the first key is used, in alphabetical order.
OneAgent automatically extracts any string fields whose names start with dt. (for example, dt.trace_id or dt.span_id), if they are located at the root or first inner level of the JSON object, and adds them as attributes.
The supported timestamp patterns for JSON logs, from fields or prefixes, are the same as for plain-text logs.
To learn more about log levels, go to Automatic log enrichment.
Automatic JSON parsing is enabled by default. If OneAgent does not recognize content in JSON format, the log file is treated as plain-text.
You can explicitly disable JSON parsing by creating a timestamp configuration rule where the JSON parsing option is disabled. To learn how to configure a timestamp rule, go to Timestamp/splitting configuration.
To disable JSON parsing for a log file:
Go to
Settings > Log Monitoring > Timestamp/Splitting patterns.
On the record of your configured timestamp rule, select Edit.
Disable the JSON format detector option.
Select Save and close.