|
1 |
| -# standard rfc5424 parsing |
2 |
| -grok { |
3 |
| - match => [ "message", "%{SYSLOG5424LINE}" ] |
4 |
| -} |
| 1 | +filter { |
| 2 | + # standard rfc5424 parsing |
| 3 | + grok { |
| 4 | + match => [ "message", "%{SYSLOG5424LINE}" ] |
| 5 | + } |
5 | 6 |
|
6 |
| -syslog_pri {} |
| 7 | + syslog_pri {} |
7 | 8 |
|
8 |
| -# extract BOSH instance metadata from structured data |
9 |
| -if [syslog5424_sd] =~ "\[instance@47450" { |
10 |
| - grok { |
11 |
| - match => [ "syslog5424_sd", "\[instance@47450 %{DATA:instance_raw}\]" ] |
| 9 | + mutate { |
| 10 | + rename => ["syslog5424_app", "job"] |
| 11 | + } |
| 12 | + mutate { |
| 13 | + rename => ["syslog5424_host", "host_address"] |
| 14 | + } |
| 15 | + date { |
| 16 | + match => [ "syslog5424_ts", "ISO8601" ] |
| 17 | + target => "@timestamp" |
| 18 | + remove_field => "syslog5424_ts" |
12 | 19 | }
|
13 | 20 |
|
14 |
| - kv { |
15 |
| - source => "instance_raw" |
16 |
| - target => "syslog5424_sd_instance" |
17 |
| - remove_field => "instance_raw" |
| 21 | + # extract BOSH instance metadata from structured data |
| 22 | + if [syslog5424_sd] =~ "\[instance@47450" { |
| 23 | + grok { |
| 24 | + match => [ "syslog5424_sd", "\[instance@47450 %{DATA:source_raw}\]" ] |
| 25 | + } |
| 26 | + |
| 27 | + kv { |
| 28 | + source => "source_raw" |
| 29 | + target => "source" |
| 30 | + remove_field => "source_raw" |
| 31 | + } |
| 32 | + |
| 33 | + mutate { |
| 34 | + remove_field => "syslog5424_sd" |
| 35 | + } |
| 36 | + } |
| 37 | + |
| 38 | + if [syslog5424_msg] =~ /^{.*}/ { |
| 39 | + json { |
| 40 | + source => "syslog5424_msg" |
| 41 | + target => "parsed_json" |
| 42 | + remove_field => "syslog5424_msg" |
| 43 | + add_tag => [ "json" ] |
| 44 | + } |
| 45 | + |
| 46 | + date { |
| 47 | + match => ["[parsed_json][timestamp]", "ISO8601", "UNIX"] |
| 48 | + target => ["[parsed_json][timestamp]"] |
| 49 | + } |
18 | 50 | }
|
19 | 51 | }
|
0 commit comments