-
Notifications
You must be signed in to change notification settings - Fork 44
/
logstash-filters.conf
51 lines (44 loc) · 1.01 KB
/
logstash-filters.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
filter {
# standard rfc5424 parsing
grok {
match => [ "message", "%{SYSLOG5424LINE}" ]
}
syslog_pri {}
mutate {
rename => ["syslog5424_app", "job"]
}
mutate {
rename => ["syslog5424_host", "host_address"]
}
date {
match => [ "syslog5424_ts", "ISO8601" ]
target => "@timestamp"
remove_field => "syslog5424_ts"
}
# extract BOSH instance metadata from structured data
if [syslog5424_sd] =~ "\[instance@47450" {
grok {
match => [ "syslog5424_sd", "\[instance@47450 %{DATA:source_raw}\]" ]
}
kv {
source => "source_raw"
target => "source"
remove_field => "source_raw"
}
mutate {
remove_field => "syslog5424_sd"
}
}
if [syslog5424_msg] =~ /^{.*}/ {
json {
source => "syslog5424_msg"
target => "parsed_json"
remove_field => "syslog5424_msg"
add_tag => [ "json" ]
}
date {
match => ["[parsed_json][timestamp]", "ISO8601", "UNIX"]
target => ["[parsed_json][timestamp]"]
}
}
}