forked from elastic/integrations
-
Notifications
You must be signed in to change notification settings - Fork 0
/
json.yml
59 lines (56 loc) · 1.45 KB
/
json.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
description: Pipeline for processing Hashicorp Vault operational logs in JSON format.
processors:
- json:
field: event.original
target_field: hashicorp_vault.log
#
# @timestamp
#
- date:
field: hashicorp_vault.log.@timestamp
formats:
- ISO8601
- remove:
field:
- hashicorp_vault.log.@timestamp
ignore_missing: true
#
# Rename standard fields to ECS.
#
- rename:
field: hashicorp_vault.log.@level
target_field: log.level
ignore_missing: true
- rename:
field: hashicorp_vault.log.@message
target_field: message
ignore_missing: true
- rename:
field: hashicorp_vault.log.@module
target_field: log.logger
ignore_missing: true
- script:
description: Drop hashicorp_vault.log if empty.
tag: drop-empty-hashicorp_vault.log
lang: painless
if: ctx?.hashicorp_vault?.log != null && ctx.hashicorp_vault.log.isEmpty()
source: |
ctx.hashicorp_vault.remove("log");
if (ctx.hashicorp_vault.isEmpty()) {
ctx.remove("hashicorp_vault");
}
#
# Copy structured fields to ECS fields. Retain the originals for easy reference.
#
- set:
field: file.path
copy_from: hashicorp_vault.log.file_path
ignore_failure: true
on_failure:
- set:
field: event.kind
value: pipeline_error
- append:
field: error.message
value: '{{{ _ingest.on_failure_message }}}'