forked from logstash/cookbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogstash-indexer_NAT.conf
32 lines (30 loc) · 975 Bytes
/
logstash-indexer_NAT.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
# Example of extending the syslog filters for a specific syslog format.
# This example matches the NAT logs on my linux firewalls.
# Slip this into the logstash-indexer.conf just before the filter stanza is closed.
grep {
type => "syslog"
match => ["@message","^RULE"]
add_tag => "is_Linux_NAT"
drop => false
}
kv {
type => "syslog"
tags => [ "is_Linux_NAT" ]
prefix => "nat_"
}
grok {
type => "syslog"
tags => [ "is_Linux_NAT" ]
pattern => [ "^RULE %{NUMBER:nat_Rule} -- %{DATA:nat_Action} %{GREEDYDATA:message_remainder}" ]
}
mutate {
type => "syslog"
tags => [ "is_Linux_NAT" ]
replace => [ "@message", "NAT - %{nat_Action} -- %{nat_SRC}:%{nat_SPT} -> %{nat_DST}:%{nat_DPT}" ]
}
mutate {
# XXX must not be combined with replacement which uses same field
type => "syslog"
tags => [ "is_Linux_NAT" ]
remove => [ "message_remainder" ]
}