Skip to content

Commit e55da04

Browse files
authored
[iptables,journald] Re-enable system tests for journald inputs (#5984)
system tests for the journald input have been disabled to a segfault. This uses a workaround to avoid that segfault so we can continue testing. While performing that testing I discovered that neither iptables nor journald were aligned with the current ECS definition of the log.syslog.* fields. ECS added numerous log.syslog fields that should be used by journald/iptables instead of syslog.*. And because journald is an input package this needs to be done without an Ingest Pipeline so that users with custom pipelines can benefit. Bump stack version for the iptables integration to get journald input fixes. Closes #2602 Relates elastic/elastic-package#1236
1 parent 3a4bec1 commit e55da04

File tree

23 files changed

+708
-134
lines changed

23 files changed

+708
-134
lines changed

packages/iptables/changelog.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# newer versions go on top
2+
- version: "1.6.0"
3+
changes:
4+
- description: Align journald syslog fields with ECS.
5+
type: bugfix
6+
link: https://github.com/elastic/integrations/pull/5984
27
- version: "1.5.0"
38
changes:
49
- description: Update package to ECS 8.7.0.

packages/iptables/data_stream/log/_dev/test/pipeline/test-journald.json-expected.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@
7171
},
7272
"log": {
7373
"syslog": {
74+
"appname": "kernel",
7475
"facility": {
7576
"code": 0
7677
},
77-
"identifier": "kernel",
7878
"priority": 7
7979
}
8080
},
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
service: iptables-log-journald
2-
skip:
3-
reason: "A bug on the host journald causes our journald input to panic"
4-
link: https://github.com/elastic/integrations/issues/2602
52
input: journald
63
data_stream:
74
vars:
85
paths:
9-
- "{{SERVICE_LOGS_DIR}}/iptables.journal"
6+
- "/run/service_logs/iptables.journal"

packages/iptables/data_stream/log/_dev/test/system/test-logfile-config.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/iptables/data_stream/log/_dev/test/system/test-udp-config.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/iptables/data_stream/log/elasticsearch/ingest_pipeline/default.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ processors:
2323
ignore_missing: true
2424
- rename:
2525
field: syslog.pid
26-
target_field: log.syslog.pid
26+
target_field: log.syslog.procid
2727
ignore_missing: true
2828
- rename:
2929
field: syslog.identifier
30-
target_field: log.syslog.identifier
30+
target_field: log.syslog.appname
3131
ignore_missing: true
3232
- remove:
3333
description: Cleanup an empty syslog object.

packages/iptables/data_stream/log/fields/ecs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,14 @@
3232
name: event.outcome
3333
- external: ecs
3434
name: log.file.path
35+
- external: ecs
36+
name: log.syslog.appname
3537
- external: ecs
3638
name: log.syslog.facility.code
3739
- external: ecs
3840
name: log.syslog.priority
41+
- external: ecs
42+
name: log.syslog.procid
3943
- external: ecs
4044
name: message
4145
- external: ecs

packages/iptables/data_stream/log/fields/journald-input.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,5 @@
55
66
- name: systemd.transport
77
type: keyword
8-
description: >
9-
How the entry was received by the journal service.
10-
11-
- name: log.syslog.identifier
12-
type: keyword
13-
description: >
14-
Identifier (usually process) contained in the syslog header.
15-
16-
- name: log.syslog.pid
17-
type: long
188
description: >-
19-
PID contained in the syslog header.
9+
How the entry was received by the journal service.

packages/iptables/data_stream/log/sample_event.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"@timestamp": "2021-03-12T14:10:18.000Z",
33
"agent": {
4-
"ephemeral_id": "fe763653-ca99-4a13-b01e-f49e33946306",
5-
"id": "660f37cf-e109-4766-b85b-8150ca4cd173",
4+
"ephemeral_id": "9d70b3da-b816-48af-9c86-8e6c6a5bf0fb",
5+
"id": "4e644293-3984-48e7-a63c-00be2338b58d",
66
"name": "docker-fleet-agent",
77
"type": "filebeat",
8-
"version": "8.4.1"
8+
"version": "8.8.0"
99
},
1010
"data_stream": {
1111
"dataset": "iptables.log",
@@ -21,19 +21,19 @@
2121
"version": "8.7.0"
2222
},
2323
"elastic_agent": {
24-
"id": "660f37cf-e109-4766-b85b-8150ca4cd173",
25-
"snapshot": false,
26-
"version": "8.4.1"
24+
"id": "4e644293-3984-48e7-a63c-00be2338b58d",
25+
"snapshot": true,
26+
"version": "8.8.0"
2727
},
2828
"event": {
2929
"action": "drop",
3030
"agent_id_status": "verified",
3131
"category": [
3232
"network"
3333
],
34-
"created": "2022-10-20T04:11:20.974Z",
34+
"created": "2023-04-25T19:13:39.793Z",
3535
"dataset": "iptables.log",
36-
"ingested": "2022-10-20T04:11:22Z",
36+
"ingested": "2023-04-25T19:13:40Z",
3737
"kind": "event",
3838
"timezone": "+00:00",
3939
"type": [
@@ -72,7 +72,7 @@
7272
},
7373
"log": {
7474
"source": {
75-
"address": "172.18.0.4:54943"
75+
"address": "172.18.0.5:39990"
7676
},
7777
"syslog": {
7878
"priority": 6

packages/iptables/docs/README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ An example event for `log` looks as following:
2121
{
2222
"@timestamp": "2021-03-12T14:10:18.000Z",
2323
"agent": {
24-
"ephemeral_id": "fe763653-ca99-4a13-b01e-f49e33946306",
25-
"id": "660f37cf-e109-4766-b85b-8150ca4cd173",
24+
"ephemeral_id": "9d70b3da-b816-48af-9c86-8e6c6a5bf0fb",
25+
"id": "4e644293-3984-48e7-a63c-00be2338b58d",
2626
"name": "docker-fleet-agent",
2727
"type": "filebeat",
28-
"version": "8.4.1"
28+
"version": "8.8.0"
2929
},
3030
"data_stream": {
3131
"dataset": "iptables.log",
@@ -41,19 +41,19 @@ An example event for `log` looks as following:
4141
"version": "8.7.0"
4242
},
4343
"elastic_agent": {
44-
"id": "660f37cf-e109-4766-b85b-8150ca4cd173",
45-
"snapshot": false,
46-
"version": "8.4.1"
44+
"id": "4e644293-3984-48e7-a63c-00be2338b58d",
45+
"snapshot": true,
46+
"version": "8.8.0"
4747
},
4848
"event": {
4949
"action": "drop",
5050
"agent_id_status": "verified",
5151
"category": [
5252
"network"
5353
],
54-
"created": "2022-10-20T04:11:20.974Z",
54+
"created": "2023-04-25T19:13:39.793Z",
5555
"dataset": "iptables.log",
56-
"ingested": "2022-10-20T04:11:22Z",
56+
"ingested": "2023-04-25T19:13:40Z",
5757
"kind": "event",
5858
"timezone": "+00:00",
5959
"type": [
@@ -92,7 +92,7 @@ An example event for `log` looks as following:
9292
},
9393
"log": {
9494
"source": {
95-
"address": "172.18.0.4:54943"
95+
"address": "172.18.0.5:39990"
9696
},
9797
"syslog": {
9898
"priority": 6
@@ -238,10 +238,10 @@ An example event for `log` looks as following:
238238
| log.file.path | Full path to the log file this event came from, including the file name. It should include the drive letter, when appropriate. If the event wasn't read from a log file, do not populate this field. | keyword |
239239
| log.offset | Log offset | long |
240240
| log.source.address | Source address of the syslog message. | keyword |
241+
| log.syslog.appname | The device or application that originated the Syslog message, if available. | keyword |
241242
| log.syslog.facility.code | The Syslog numeric facility of the log event, if available. According to RFCs 5424 and 3164, this value should be an integer between 0 and 23. | long |
242-
| log.syslog.identifier | Identifier (usually process) contained in the syslog header. | keyword |
243-
| log.syslog.pid | PID contained in the syslog header. | long |
244243
| log.syslog.priority | Syslog numeric priority of the event, if available. According to RFCs 5424 and 3164, the priority is 8 \* facility + severity. This number is therefore expected to contain a value between 0 and 191. | long |
244+
| log.syslog.procid | The process name or ID that originated the Syslog message, if available. | keyword |
245245
| message | For log events the message field contains the log message, optimized for viewing in a log viewer. For structured logs without an original message field, other fields can be concatenated to form a human-readable summary of the event. If multiple messages exist, they can be combined into one message. | match_only_text |
246246
| network.community_id | A hash of source and destination IPs and ports, as well as the protocol used in a communication. This is a tool-agnostic standard to identify flows. Learn more at https://github.com/corelight/community-id-spec. | keyword |
247247
| network.forwarded_ip | Host IP address when the source IP address is the proxy. | ip |

0 commit comments

Comments
 (0)