Skip to content

Commit a5c28d2

Browse files
committed
Update logline format description in configuration.rst
1 parent af7383c commit a5c28d2

File tree

2 files changed

+64
-27
lines changed

2 files changed

+64
-27
lines changed

docs/configuration.rst

Lines changed: 63 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,101 @@
11
Logline format configuration
22
............................
33

4-
Users can define the format and fields of their DNS server loglines. For this, change the
5-
``pipeline.log_collection.collector.logline_format`` parameter:
4+
Configure the format and validation rules for DNS server loglines through flexible field definitions that
5+
support timestamps, IP addresses, regular expressions, and list-based validation.
6+
7+
Configuration Overview
8+
^^^^^^^^^^^^^^^^^^^^^^
9+
10+
Users can define the format and fields of their DNS server loglines through the
11+
``pipeline.log_collection.collector.logline_format`` parameter. This configuration allows complete customization
12+
of field types, validation rules, and filtering criteria for incoming log data.
613

714
For example, a logline might look like this:
815

916
.. code-block:: console
1017
11-
2025-04-04T14:45:32.458Z NXDOMAIN 192.168.3.152 10.10.0.3 test.com AAAA 192.168.15.34 196b
18+
2025-04-04T14:45:32.458123Z NXDOMAIN 192.168.3.152 10.10.0.3 test.com AAAA 192.168.15.34 196b
19+
20+
Field Definition Structure
21+
^^^^^^^^^^^^^^^^^^^^^^^^^^
1222

1323
Each list entry of the parameter defines one field of the input logline, and the order of the entries corresponds to the
1424
order of the values in each logline. Each list entry itself consists of a list with
15-
three or four entries: For example, a field definition might look like this:
25+
two to four entries depending on the field type. For example, a field definition might look like this:
1626

1727
.. code-block:: console
1828
1929
[ "status_code", ListItem, [ "NOERROR", "NXDOMAIN" ], [ "NXDOMAIN" ] ]
2030
21-
The first entry always corresponds to the name of the field. Some field values must exist in the logline, as they are
22-
used by the modules. Some field names are cannot be used, as they are defined for internal communication.
31+
Field Names and Requirements
32+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33+
34+
The first entry of each field definition always corresponds to the name of the field. Certain field names are required
35+
for proper pipeline operation, while others are forbidden as they are reserved for internal use.
2336

2437
.. list-table:: Required and forbidden field names
25-
:header-rows: 0
38+
:header-rows: 1
2639
:widths: 15 50
2740

28-
* - Required
41+
* - Category
42+
- Field Names
43+
* - **Required**
2944
- ``timestamp``, ``status_code``, ``client_ip``, ``record_type``, ``domain_name``
30-
* - Forbidden
45+
* - **Forbidden**
3146
- ``logline_id``, ``batch_id``
3247

33-
The second entry specifies the type of the field. Depending on the type defined here, the method for defining the
34-
possible values varies. The third and fourth entry change depending on the type.
35-
Please check the following table for more information on the types.
48+
**Required fields** must be present in the configuration as they are essential for pipeline processing.
49+
**Forbidden fields** are reserved for internal communication and cannot be used as custom field names.
50+
51+
Field Types and Validation
52+
^^^^^^^^^^^^^^^^^^^^^^^^^^
53+
54+
The second entry specifies the type of the field. Depending on the type defined, the method for defining
55+
validation parameters varies. The third and fourth entries change depending on the type.
3656

37-
There are three types to choose from:
57+
There are four field types available:
3858

3959
.. list-table:: Field types
4060
:header-rows: 1
41-
:widths: 20 20 20 30
61+
:widths: 20 25 20 35
4262

4363
* - Field type
4464
- Format of 3rd entry
4565
- Format of 4th entry
4666
- Description
67+
* - ``Timestamp``
68+
- Timestamp format string
69+
- *(not used)*
70+
- Validates timestamp fields using Python's strptime format. Automatically converts to ISO format for internal processing.
71+
Example: ``"%Y-%m-%dT%H:%M:%S.%fZ"``
72+
* - ``IpAddress``
73+
- *(not used)*
74+
- *(not used)*
75+
- Validates IPv4 and IPv6 addresses. No additional parameters required.
4776
* - ``RegEx`` (Regular Expression)
4877
- RegEx pattern as string
49-
-
50-
- The logline field is checked against the pattern. If the pattern is met, the field is valid.
78+
- *(not used)*
79+
- Validates field content against a regular expression pattern. If the pattern matches, the field is valid.
5180
* - ``ListItem``
52-
- List of values
53-
- List of values (optional)
54-
- If the logline field value is in the first list, it is valid. If it is also in the second list, it is relevant
55-
for the inspection and detection algorithm. All values in the second list must also be in the first list, not
56-
vice versa. If this entry is not specified, all values are deemed relevant.
57-
* - ``IpAddress``
58-
-
59-
-
60-
- If the logline field value is an IPv4 or IPv6 address, it is valid.
81+
- List of allowed values
82+
- List of relevant values *(optional)*
83+
- Validates field values against an allowed list. Optionally defines relevant values for filtering in later pipeline stages.
84+
All relevant values must also be in the allowed list. If not specified, all allowed values are deemed relevant.
85+
86+
Configuration Examples
87+
^^^^^^^^^^^^^^^^^^^^^
88+
89+
Here are examples for each field type:
90+
91+
.. code-block:: yaml
92+
93+
logline_format:
94+
- [ "timestamp", Timestamp, "%Y-%m-%dT%H:%M:%S.%fZ" ]
95+
- [ "status_code", ListItem, [ "NOERROR", "NXDOMAIN" ], [ "NXDOMAIN" ] ]
96+
- [ "client_ip", IpAddress ]
97+
- [ "domain_name", RegEx, '^(?=.{1,253}$)((?!-)[A-Za-z0-9-]{1,63}(?<!-)\.)' ]
98+
- [ "record_type", ListItem, [ "A", "AAAA" ] ]
6199
62100
63101
Logging Configuration

docs/pipeline.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,7 @@ The :class:`BufferedBatchSender` manages the sending of validated loglines store
234234
Configuration
235235
-------------
236236

237-
The :class:`LogCollector` checks the validity of incoming loglines. For this, it uses the ``logline_format`` configured
238-
in the ``config.yaml``.
237+
The :class:`LogCollector` checks the validity of incoming loglines. For this, it uses the ``logline_format`` configured in the ``config.yaml``. Section :ref:`Logline format configuration` provides detailed information on how to customize the logline format and field definitions. The LogCollector uses the following configuration options from the configuration:
239238

240239
- **LogCollector Analyzation Criteria**:
241240

0 commit comments

Comments
 (0)