The Service Map for APM is here!

Processors

original log

A Processor executes within a pipeline a data-structuring action (Remapping an attribute, Grok parsing…) on a log.

The different kinds of Processors are explained below.

Grok Parser

Create custom grok rules to parse the full message or a specific attribute of your raw event:

Parser

Read more about this in the parsing section

Log Date Remapper

As Datadog receives logs, it timestamps them using the value(s) from any of these default attributes:

  • timestamp
  • date
  • _timestamp
  • Timestamp
  • eventTime
  • published_date

If your logs put their dates in an attribute not in this list, use the log date Remapper Processor to define their date attribute as the official log timestamp:

Log date Remapper

If your logs don’t contain any of the default attributes and you haven’t defined your own date attribute, Datadog timestamps the logs with the date it received them.

Log Status Remapper

Use this Processor if you want to assign some attributes as the official status. Just enter the attribute path in the Processor tile as follows:

Severity Remapper Processor tile

It transforms this log:

 Log pre severity

Into this log:

 Log post severity bis

However, be aware that each incoming status value is mapped as follows:

  • Integers from 0 to 7 map to the Syslog severity standards
  • Strings beginning with emerg or f (case-insensitive) map to emerg (0)
  • Strings beginning with a (case-insensitive) map to alert (1)
  • Strings beginning with c (case-insensitive) map to critical (2)
  • Strings beginning with err (case-insensitive) map to error (3)
  • Strings beginning with w (case-insensitive) map to warning (4)
  • Strings beginning with n (case-insensitive) map to notice (5)
  • Strings beginning with i (case-insensitive) map to info (6)
  • Strings beginning with d, trace or verbose (case-insensitive) map to debug (7)
  • Strings matching OK or Sucess (case-insensitive) map to OK
  • All others map to info (6)

Remapper

This Processor remaps any source attribute(s) or tag to another target attribute or tag. For instance, here, it remaps user to user.firstname

Attribute Remapper Processor tile

It transforms this log:

attribute pre remapping

Into this log:

attribute post remapping

Constraints on the tag/attribute name are explained in the Tag Best Practice documentation. Some additional constraints are applied as :, /, or , are not allowed in the target tag/attribute name.

URL Parser

This Processor extracts query parameters and other important parameters from a URL. To use it, just enter the source attribute of your url:

These settings:

Url Processor Tile

Give the following results:

Url Processor

User-Agent parser

The User-Agent parser takes a User-Agent attribute and does its best to extract the OS, browser, device, etc… It recognizes major bots like the Google Bot, Yahoo Slurp, Bing, and others.

If your logs contain encoded User-Agents (as, for example, IIS logs do), configure this Processor to decode the URL before parsing it.

These settings:

Useragent Processor tile

Give the following results:

Useragent Processor

Category Processor

Use the Category Processor to add a new attribute (without spaces or special characters in the new attribute name) to a log matching a provided search query. Categories are very useful to create meaningful groups which can be used in any analytical view (e.g. URL groups, Machine groups, environments, response time buckets, etc….).

For example to categories your web access logs depending of the status code range value (2xx for a response code between 200 and 299, 3xx for a response code between 300 and 399, …) add this Processor:

Category Processor

It produces the following result:

Category Processor result

Important Note: The query can be done on any log attribute or tag, whether it is a facet or not. Wildcards can also be used inside your query. Once the log has matched one of the Processor queries, it stops. Make sure they are properly ordered in case a log could match several queries.

Log Message Remapper

The message is a key attribute in Datadog. It is displayed in the message column of the Log Explorer and you can do full string search on it. Use this Processor to define some attributes as the official log message: just enter the attribute path in the Processor tile as follows:

Message Processor

Further Reading