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

[Filebeat] Improve ECS categorization in elasticsearch module #16469

Merged
merged 11 commits into from
Mar 12, 2020
Prev Previous commit
Next Next commit
Add ECS 1.4 categorization to elasticsearch server pipeline
- event.kind
- event.category
- event.type
- host.name
- host.id
  • Loading branch information
leehinman committed Mar 12, 2020
commit 9c784ffa0ddfe41e72220a10f54df55ade064ee0
26 changes: 26 additions & 0 deletions filebeat/module/elasticsearch/server/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,32 @@ processors:
milliseconds_unit: ms
ms_in_one_s: 1000
ms_in_one_m: 60000

- set:
field: event.kind
value: event
- set:
field: event.category
value: database
- script:
lang: painless
source: >-
def errorLevels = ['FATAL', 'ERROR'];
if (ctx?.log?.level != null) {
if (errorLevels.contains(ctx.log.level)) {
ctx.event.type = 'error';
} else {
ctx.event.type = 'info';
}
}
- set:
field: host.name
value: "{{elasticsearch.node.name}}"
if: "ctx?.elasticsearch?.node?.name != null"
- set:
field: host.id
value: "{{elasticsearch.node.id}}"
if: "ctx?.elasticsearch?.node?.id != null"
- remove:
field:
- elasticsearch.server.gc.collection_duration.time
Expand Down
Loading