{% extends "siem/base.html" %} {% block sub-title %}Parsing Documentation | {% endblock %} {% block content-main %}

Parsing Documentation


Parse Daemon

The parse daemon is the program that parses log files into log events in the LogESP database. The files it parses are defined in the parser configuration file, at config/parser.conf in the repository. This configuration file also defines which event type to assign to events, which parser to use, the lifespan of the events, and optionally which parse helper type to use, and which syslog facility to assign.

For more on running the parse daemon, see the daemon documentation.


Event Parsing

The parse daemon parses events using instructions from a parser, and optionally a group of parse helpers. The parser parses basic fields that are present in all events in the file being parsed, and parse helpers can be used to parse extra fields that aren't present in every single event.

Parsers

Parsers provide the parse daemon with instructions for parsing fields from events. Along with a name and description, parsers contain sets of matching information. Each set consists of a regular expression, and a comma-separated list of fields pulled by that regular expression. The fields can be any log event attribute (e.g. source_host, dest_host, target_user; see Anatomy of a Log Event)

Each parser can have two sets of regex/field pairs: a primary, and a backup. If the primary regular expression doesn't find a match, the backup will be tried.

Parse Helpers

Parse helpers contain a regular expression and a comma-separated list of fields, similar to a parser. After parsing the main fields, the parse daemon tries each parse helper (of the helper type defined in the config file). If it finds a match, it pulls out extra fields; if not, it just moves on. Parse helpers are useful for parsing regular expressions and fields that aren't present in every single event.


Configuration

The parser configuration file at `config/parser.conf` has one section per file. Here is an example section:

[auth]
filename=/var/log/auth.log
event_type=auth
parser=syslog
helper_type=auth
local_lifespan_days=185
backup_lifespan_days=366

A few more settings are available, in addition to the ones used above:

{% endblock %}