-
Notifications
You must be signed in to change notification settings - Fork 3
/
30-rspamd.conf
46 lines (41 loc) · 1.27 KB
/
30-rspamd.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
filter {
if [fields][beats_output] == "rspamd" {
grok {
patterns_dir => "/etc/logstash/patterns.d"
match => { "message" => "%{RSPAMD}" }
overwrite => ["message"]
}
if [rspamd][module] =~ /^milter$/ {
grok {
patterns_dir => "/etc/logstash/patterns.d"
match => [ "message", "^%{RSPAMD_MILTER}$" ]
tag_on_failure => [ "_grok_rspamd_milter_nomatch" ]
add_tag => [ "_grok_rspamd_success" ]
}
}
date {
match => [ "[rspamd][timestamp]", "yyyy-MM-dd HH:mm:ss" ]
timezone => "Europe/Berlin"
locale => "de"
target => "timestamp"
remove_field => ["[rspamd][timestamp]"]
}
if [rspamd][milter][ip] {
geoip {
source => "[rspamd][milter][ip]"
target => "[rspamd][milter][geoip]"
}
mutate {
add_field => {"[rspamd][milter][hostname]" => "%{[rspamd][milter][ip]}"}
}
dns {
reverse => [ "[rspamd][milter][hostname]" ]
action => "replace"
hit_cache_size => 8000
hit_cache_ttl => 300
failed_cache_size => 1000
failed_cache_ttl => 300
}
}
}
}