-
Notifications
You must be signed in to change notification settings - Fork 0
/
filter-50-submission.conf
50 lines (46 loc) · 1.76 KB
/
filter-50-submission.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
filter {
if [postfix][component] == "submission" {
# matches connect from and disconnect from
# not very efficient to check every log this way
# contributions with better checks are very welcome :-)
if [message] =~ /connect from/ {
grok {
match => ["message","(dis)?connect from %{HOSTNAME:[client][domain]}\[%{IP:[client][address]}\](%{GREEDYDATA:[@metadata][connectdetail]})?"]
id => "postfix_submission_connect"
tag_on_failure => ["_grokparsefailure","postfix_submission_connect_failed"]
add_field => {
"[postfix][eventtype]" => "submission_connect"
}
add_tag => "grokked"
}
}
if [message] =~ /^warning: .*authentication failed/ {
grok {
match => ["message","warning: %{HOSTNAME:[client][domain]}\[%{IP:[client][address]}\]: %{GREEDYDATA:[postfix][detail]}"]
id => "postfix_submission_authenticationfailed"
tag_on_failure => ["_grokparsefailure","postfix_submission_authenticationfailed"]
add_field => {
"[postfix][eventtype]" => "submission_authenticationfailed"
}
add_tag => "grokked"
}
}
if [message] =~ /^Anonymous TLS connection established from/ {
grok {
match => ["message","Anonymous TLS connection established from %{HOSTNAME:[client][domain]}\[%{IP:[client][address]}\]: %{GREEDYDATA:[postfix][detail]}"]
id => "postfix_submission_anontls"
tag_on_failure => ["_grokparsefailure","postfix_submission_anontls"]
add_field => {
"[postfix][eventtype]" => "submission_anontls"
}
add_tag => "grokked"
}
}
if [@metadata][connectdetail] {
kv {
source => "[@metadata][connectdetail]"
target => "[postfix]"
}
}
}
}