forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve ECS categorization field mapping in icinga (elastic#16533)
- event.kind - event.type Closes elastic#16164 (cherry picked from commit b82a427)
- Loading branch information
Showing
13 changed files
with
127 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
description: Pipeline for parsing icinga debug logs | ||
processors: | ||
- grok: | ||
field: message | ||
patterns: | ||
- '\[%{TIMESTAMP:icinga.debug.timestamp}\] %{WORD:log.level}/%{WORD:icinga.debug.facility}: | ||
%{GREEDYMULTILINE:message}' | ||
ignore_missing: true | ||
pattern_definitions: | ||
TIMESTAMP: '%{YEAR}-%{MONTHNUM}-%{MONTHDAY} %{HOUR}:%{MINUTE}:%{SECOND} %{ISO8601_TIMEZONE}' | ||
GREEDYMULTILINE: |- | ||
(.| | ||
)* | ||
- date: | ||
field: icinga.debug.timestamp | ||
target_field: '@timestamp' | ||
formats: | ||
- yyyy-MM-dd HH:mm:ss Z | ||
ignore_failure: true | ||
- remove: | ||
field: icinga.debug.timestamp | ||
- set: | ||
field: event.kind | ||
value: event | ||
- script: | ||
lang: painless | ||
source: >- | ||
def errorLevels = ["warning", "critical"]; | ||
if (ctx?.log?.level != null) { | ||
if (errorLevels.contains(ctx.log.level)) { | ||
ctx.event.type = "error"; | ||
} else { | ||
ctx.event.type = "info"; | ||
} | ||
} | ||
on_failure: | ||
- set: | ||
field: error.message | ||
value: '{{ _ingest.on_failure_message }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
description: Pipeline for parsing icinga main logs | ||
processors: | ||
- grok: | ||
field: message | ||
patterns: | ||
- '\[%{TIMESTAMP:icinga.main.timestamp}\] %{WORD:log.level}/%{WORD:icinga.main.facility}: | ||
%{GREEDYMULTILINE:message}' | ||
ignore_missing: true | ||
pattern_definitions: | ||
TIMESTAMP: '%{YEAR}-%{MONTHNUM}-%{MONTHDAY} %{HOUR}:%{MINUTE}:%{SECOND} %{ISO8601_TIMEZONE}' | ||
GREEDYMULTILINE: |- | ||
(.| | ||
)* | ||
- date: | ||
field: icinga.main.timestamp | ||
target_field: '@timestamp' | ||
formats: | ||
- yyyy-MM-dd HH:mm:ss Z | ||
ignore_failure: true | ||
- remove: | ||
field: icinga.main.timestamp | ||
- set: | ||
field: event.kind | ||
value: event | ||
- script: | ||
lang: painless | ||
source: >- | ||
def errorLevels = ["warning", "critical"]; | ||
if (ctx?.log?.level != null) { | ||
if (errorLevels.contains(ctx.log.level)) { | ||
ctx.event.type = "error"; | ||
} else { | ||
ctx.event.type = "info"; | ||
} | ||
} | ||
on_failure: | ||
- set: | ||
field: error.message | ||
value: '{{ _ingest.on_failure_message }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
description: Pipeline for parsing icinga startup logs | ||
processors: | ||
- grok: | ||
field: message | ||
patterns: | ||
- '%{WORD:log.level}/%{WORD:icinga.startup.facility}: %{GREEDYMULTILINE:message}' | ||
ignore_missing: true | ||
pattern_definitions: | ||
GREEDYMULTILINE: |- | ||
(.| | ||
)* | ||
- set: | ||
field: event.kind | ||
value: event | ||
- script: | ||
lang: painless | ||
source: >- | ||
def errorLevels = ["warning", "critical"]; | ||
if (ctx?.log?.level != null) { | ||
if (errorLevels.contains(ctx.log.level)) { | ||
ctx.event.type = "error"; | ||
} else { | ||
ctx.event.type = "info"; | ||
} | ||
} | ||
on_failure: | ||
- set: | ||
field: error.message | ||
value: '{{ _ingest.on_failure_message }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters