-
Notifications
You must be signed in to change notification settings - Fork 3
/
20-fail2ban.conf
44 lines (41 loc) · 1.16 KB
/
20-fail2ban.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
filter {
if [fields][beats_output] == "fail2ban" {
grok {
patterns_dir => "/etc/logstash/patterns.d"
match => { "message" => "%{FAIL2BAN}" }
overwrite => ["message"]
}
date {
match => [ "[fail2ban][timestamp]", "ISO8601" ]
timezone => "Europe/Berlin"
locale => "de"
target => "timestamp"
remove_field => ["[fail2ban][timestamp]"]
}
if [fail2ban][source][ip] {
geoip {
source => "[fail2ban][source][ip]"
target => "[fail2ban][geoip]"
}
mutate {
add_field => {"[fail2ban][source][hostname]" => "%{[fail2ban][source][ip]}"}
}
dns {
reverse => [ "[fail2ban][source][hostname]" ]
action => "replace"
hit_cache_size => 8000
hit_cache_ttl => 300
failed_cache_size => 1000
failed_cache_ttl => 300
}
mutate {
update => { "message" => "[%{[fail2ban][service]}] %{[fail2ban][action]} %{[fail2ban][source][ip]} (%{[fail2ban][source][hostname]})" }
}
}
mutate {
convert => [
"[fail2ban][pid]", "integer"
]
}
}
}