Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable enriched fields where there is a nested kv under a msg=... field #12284

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/auditd/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "3.20.3"
changes:
- description: Allow enriched fields on more auditd log messages
type: bugfix
link: https://github.com/elastic/integrations/pull/12284
- version: "3.20.2"
changes:
- description: Use triple-brace Mustache templating when referencing variables in ingest pipelines.
Expand Down Expand Up @@ -248,7 +253,7 @@
- description: Convert to generated ECS fields
type: enhancement
link: https://github.com/elastic/integrations/pull/1464
- version: '1.1.2'
- version: "1.1.2"
changes:
- description: update to ECS 1.11.0
type: enhancement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ processors:
AVC_PREFIX: 'avc:%{SPACE}%{WORD:auditd.log.avc.action}%{SPACE}{%{SPACE}%{WORD:auditd.log.avc.request}%{SPACE}}%{SPACE}for%{SPACE}'
MESSAGE: "(?:'(?:%{AVC_PREFIX}|[^=]*\\s)?%{ANY:auditd.log.sub_kv}'|\"([^=]*\\s)?%{ANY:auditd.log.sub_kv}\")"
GS: '\x1d'
ENRICHED_FIELDS: '((?:%{GS})%{AUDIT_KEY_VALUES:auditd.log.sub_kv_enriched})?'
ANY: ".*"
patterns:
- '%{AUDIT_PREFIX} %{AUDIT_KEY_VALUES:auditd.log.kv} old auid=%{NUMBER:auditd.log.old_auid} new auid=%{NUMBER:auditd.log.new_auid} old ses=%{NUMBER:auditd.log.old_ses} new ses=%{NUMBER:auditd.log.new_ses}'
- '%{AUDIT_PREFIX} %{AUDIT_KEY_VALUES:auditd.log.kv} msg=%{MESSAGE}'
- '%{AUDIT_PREFIX} %{AUDIT_KEY_VALUES:auditd.log.kv} msg=%{MESSAGE}%{ENRICHED_FIELDS}'
- '%{AUDIT_PREFIX} %{AUDIT_KEY_VALUES:auditd.log.kv}%{GS}%{WORD:auditd.log.original_field}={ %{AUDIT_KEY_VALUES:auditd.log.sub_kv} }'
- '%{AUDIT_PREFIX} %{AVC_PREFIX}?%{AUDIT_KEY_VALUES:auditd.log.kv}'
- '%{AUDIT_PREFIX}'
Expand All @@ -40,6 +41,12 @@ processors:
value_split: '='
target_field: auditd.log
ignore_missing: true
- kv:
field: auditd.log.sub_kv_enriched
field_split: '\s+(?=[^\s]+=)'
value_split: '='
target_field: auditd.log
ignore_missing: true
- date:
field: auditd.log.epoch
target_field: "@timestamp"
Expand Down Expand Up @@ -2314,6 +2321,7 @@ processors:
field:
- auditd.log.kv
- auditd.log.sub_kv
- auditd.log.sub_kv_enriched
- auditd.log.epoch
- auditd.log.copy
- auditd.log.arch
Expand Down
2 changes: 1 addition & 1 deletion packages/auditd/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: auditd
title: Auditd Logs
version: "3.20.2"
version: "3.20.3"
description: Collect logs from Linux audit daemon with Elastic Agent.
type: integration
icons:
Expand Down