-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfilter-50-cleanup.conf
55 lines (48 loc) · 1.73 KB
/
filter-50-cleanup.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
47
48
49
50
51
52
53
54
55
filter {
if [postfix][component] == "cleanup" {
if [message] =~ /^message-id=/ {
grok {
match => ["message","message-id=<%{DATA:[postfix][msgid_long]}>"]
tag_on_failure => ["_grokparsefailure","postfix_cleanup_failed"]
id => "postfix_cleanup"
add_field => {
"[postfix][eventtype]" => "cleanup"
}
add_tag => "grokked"
}
}
if [message] =~ /^milter-reject:/ {
if [message] =~ /^milter-reject: END-OF-MESSAGE/ {
grok {
match => ["message","milter-reject: END-OF-MESSAGE from %{HOSTNAME:[client][domain]}\[%{IP:[client][address]}\]: %{GREEDYDATA:[postfix][detail]}"]
tag_on_failure => ["_grokparsefailure","postfix_cleanup_milter_eom"]
id => "postfix_cleanup_milter_eom"
add_field => {
"[postfix][eventtype]" => "cleanup_milter_eom"
}
add_tag => "grokked"
}
}
}
if [message] =~ /^reject:/ {
if [message] =~ /^reject: header/ {
grok {
match => ["message","reject: header %{DATA:[postfix][header]} from %{HOSTNAME:[client][address]}\[%{IP:[client][ip]}\]; from=<(%{DATA:[destination][user][email]})?> to=<%{DATA:[destination][user][email]}> proto=%{WORD:[postfx][proto]} helo=%{DATA:[postfix][helo]}: %{GREEDYDATA:[postfix][detail]}"]
tag_on_failure => ["_grokparsefailure","postfix_cleanup_reject_header"]
id => "postfix_cleanup_reject_header"
add_field => {
"[postfix][eventtype]" => "cleanup_reject_header"
}
add_tag => "grokked"
}
}
}
mutate {
add_field => {
"[ecs][version]" => "1.5.0"
}
}
}
}
# TODO
# replace: header Received: from [