-
Notifications
You must be signed in to change notification settings - Fork 0
/
logstash.conf
37 lines (30 loc) · 916 Bytes
/
logstash.conf
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
# input logs
input {
gelf {
port => 12201
use_udp => true
use_tcp => false
}
}
# log processing
filter {
# Remove some unnecessary fields
mutate { remove_field => ["level", "command", "image_id", "image_name", "host", "container_id", "timestamp", "severity", "created", "tag" ] }
# Parse, if possibile, the nested JSON structure
json { source => "message" }
# Remove any extra field inside the previous nested JSON
mutate { remove_field => ["timestamp", "severity"] }
# Match all the services' logs and transform them for yRCA
grok {
match => { "message" => "%{DATA:timestamp} \- %{LOGLEVEL:severity} \- %{DATA:servicename} \- %{GREEDYDATA:event}" }
}
# Fix timestamp attribute for yRCA parsing
mutate { gsub => [ "timestamp", "\Z\d{*}$", "" ] }
mutate { gsub => [ "timestamp", "Z", "" ]}
}
# output on elasticsearch
output {
file {
path => "/etc/logstash/all.json"
}
}