This repository has been archived by the owner on Jan 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfilter.conf
74 lines (69 loc) · 1.83 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# TAG the input as you like
input {
syslog {
port => "5146"
type => "syslog"
tags => "pfsense"
}
}
filter {
if "pfsense" in [tags] {
if [program] =~ /^filterlog$/ {
mutate {
add_tag => [ "packetfilter" ]
}
grok {
match => [ "message", "%{PFSENSE_LINE}" ]
patterns_dir => "/etc/logstash/patterns.d"
tag_on_failure => [ "_grok_filterlog_nomatch" ]
add_tag => [ "_grok_filterlog_success" ]
}
} else if [program] =~ /^openvpn$/ {
mutate {
add_tag => [ "openvpn" ]
}
grok {
match => [ "message", "%{PF_OVPN}" ]
patterns_dir => "/etc/logstash/patterns.d"
tag_on_failure => [ "_grok_ovpn_nomatch" ]
add_tag => [ "_grok_ovpn_success" ]
}
} else if [program] =~ /^dhcpd$/ {
mutate {
add_tag => [ "dhcpd" ]
}
grok {
match => [ "message", "%{PFSENSE_DHCPD}" ]
patterns_dir => "/etc/logstash/patterns.d"
tag_on_failure => [ "_grok_dhcpd_nomatch" ]
add_tag => [ "_grok_dhcpd_success" ]
}
}
}
}
filter {
if [source_ip] {
geoip {
source => "source_ip"
target => "source_ip_geoip"
database => "/opt/geoip/GeoLiteCity.dat"
add_field => [ "[geoip][coordinates]", "%{[geoip][longitude]}" ]
add_field => [ "[geoip][coordinates]", "%{[geoip][latitude]}" ]
}
mutate {
convert => [ "[geoip][coordinates]", "float" ]
}
}
if [dest_ip] {
geoip {
source => "dest_ip"
target => "dest_ip_geoip"
database => "/opt/geoip/GeoLiteCity.dat"
add_field => [ "[geoip][coordinates]", "%{[geoip][longitude]}" ]
add_field => [ "[geoip][coordinates]", "%{[geoip][latitude]}" ]
}
mutate {
convert => [ "[geoip][coordinates]", "float" ]
}
}
}