|
1 | 1 | Logline format configuration |
2 | 2 | ............................ |
3 | 3 |
|
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. |
6 | 13 |
|
7 | 14 | For example, a logline might look like this: |
8 | 15 |
|
9 | 16 | .. code-block:: console |
10 | 17 |
|
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 | +^^^^^^^^^^^^^^^^^^^^^^^^^^ |
12 | 22 |
|
13 | 23 | Each list entry of the parameter defines one field of the input logline, and the order of the entries corresponds to the |
14 | 24 | 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: |
16 | 26 |
|
17 | 27 | .. code-block:: console |
18 | 28 |
|
19 | 29 | [ "status_code", ListItem, [ "NOERROR", "NXDOMAIN" ], [ "NXDOMAIN" ] ] |
20 | 30 |
|
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. |
23 | 36 |
|
24 | 37 | .. list-table:: Required and forbidden field names |
25 | | - :header-rows: 0 |
| 38 | + :header-rows: 1 |
26 | 39 | :widths: 15 50 |
27 | 40 |
|
28 | | - * - Required |
| 41 | + * - Category |
| 42 | + - Field Names |
| 43 | + * - **Required** |
29 | 44 | - ``timestamp``, ``status_code``, ``client_ip``, ``record_type``, ``domain_name`` |
30 | | - * - Forbidden |
| 45 | + * - **Forbidden** |
31 | 46 | - ``logline_id``, ``batch_id`` |
32 | 47 |
|
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. |
36 | 56 |
|
37 | | -There are three types to choose from: |
| 57 | +There are four field types available: |
38 | 58 |
|
39 | 59 | .. list-table:: Field types |
40 | 60 | :header-rows: 1 |
41 | | - :widths: 20 20 20 30 |
| 61 | + :widths: 20 25 20 35 |
42 | 62 |
|
43 | 63 | * - Field type |
44 | 64 | - Format of 3rd entry |
45 | 65 | - Format of 4th entry |
46 | 66 | - 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. |
47 | 76 | * - ``RegEx`` (Regular Expression) |
48 | 77 | - 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. |
51 | 80 | * - ``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" ] ] |
61 | 99 |
|
62 | 100 |
|
63 | 101 | Logging Configuration |
|
0 commit comments