-
Notifications
You must be signed in to change notification settings - Fork 0
/
14-iptables-filter.conf
43 lines (39 loc) · 1.62 KB
/
14-iptables-filter.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
filter {
# IPTABLES
if "iptables" in [tags] {
mutate {
add_tag => [ "in_14" ]
}
grok {
break_on_match => false
match => { "message" => "%{TIMESTAMP_ISO8601:timestamp} %{HOSTNAME} %{DATA:program}: %{GREEDYDATA:content}" }
match => { "content" => "IPT:IN=%{DATA:ipt_in} OUT=%{DATA:ipt_out} MAC=%{DATA:mac} SRC=%{IP:src_ip} DST=%{IP:dst_ip} LEN=%{POSINT:length} %{DATA} PROTO=%{WORD:proto} SPT=%{POSINT:src_pt} DPT=%{POSINT:dst_pt} WINDOW=%{POSINT:window_size}%{GREEDYDATA}" }
add_tag => [ "iptables_processed" ]
tag_on_failure => ["_gpf_iptables" ]
}
}
if "iptables_processed" in [tags] {
mutate {
replace => { message => "%{content}" }
remove_field => [ "content" ]
convert => { "src_pt" => "integer" }
convert => { "dst_pt" => "integer" }
convert => { "window_size" => "integer" }
}
date {
# 2016-08-10 01:45:53.835
# 2016-08-13T17:00:47.532187+00:00
# 2016-08-13T17:03:06.073437+00:00
# 2016-08-13 T 17:04:48.230931+00:00
# 2016-08-13 T 17:18:08.598193+00:00
match => [ "timestamp", "yyyy-MM-dd'T'HH:mm:ss.SSSSSSZZ" ]
add_tag => [ "iptables_date_match" ]
tag_on_failure => [ "iptables_date_fail" ]
}
metrics {
meter => [ "iptables_total" ]
add_tag => [ "metric" ]
clear_interval => 3600 # This needs to be multiples of 5
}
}
}