-
Notifications
You must be signed in to change notification settings - Fork 2
/
logstash.conf
103 lines (95 loc) · 2.54 KB
/
logstash.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
input {
udp {
port => 5656
codec => netflow
type => netflow
}
udp {
port => 5005
tags => ["udp"]
type => sensorData
}
udp {
port => 5657
tags => ["udp"]
type => draytekSyslog
}
syslog {
port => 5658
tags => ["syslog"]
type => debianSyslog
}
}
filter {
if [type] == "netflow" {
mutate {
add_field => {"dstip" => "%{[netflow][ipv4_dst_addr]}"}
add_field => {"srcip" => "%{[netflow][ipv4_src_addr]}"}
}
geoip {
add_tag => [ "GeoIPDst" ]
source => "dstip"
target => "geoipdst"
}
geoip {
add_tag => [ "GeoIPSrc" ]
source => "srcip"
target => "geoipsrc"
}
dns {
add_tag => [ "DNSResolvDst" ]
reverse => [ "dstip" ]
action => "replace"
}
dns {
add_tag => [ "DNSResolvSrc" ]
reverse => [ "srcip" ]
action => "replace"
}
}
if [type] == "sensorData" {
json {
add_tag => [ "sensorData" ]
source => "message"
}
}
if [type] == "draytekSyslog" {
grok {
match => ["message", "<%{INT:id}>%{SYSLOGTIMESTAMP} %{WORD:deviceName}: %{DATA:user} \(MAC=%{MAC}\): %{IP:source}:%{POSINT:sPort} -> %{IP:destination}:%{POSINT:dPort} \(%{WORD:protocol}\)"]
match => ["message", "<%{INT:id}>%{SYSLOGTIMESTAMP} %{WORD:deviceName}: %{DATA:user}: %{IP:source}:%{POSINT:sPort} -> %{IP:destination}:%{POSINT:dPort} \(%{WORD:protocol}\) %{GREEDYDATA:action}"]
match => ["message", "<%{INT:id}>%{SYSLOGTIMESTAMP} %{WORD:deviceName}: %{DATA:user}: %{WORD:interface}: Tx %{INT:tKbps30} Kbps, Rx %{INT:rKbps30} Kbps \(30 min"]
match => ["message", "<%{INT:id}>%{SYSLOGTIMESTAMP} %{WORD:deviceName}: %{DATA:user}: %{WORD:interface}: Tx %{INT:tKbps5} Kbps, Rx %{INT:rKbps5} Kbps \(5 min"]
match => ["message", "<%{INT:id}>%{SYSLOGTIMESTAMP} %{WORD:deviceName}:"]
}
geoip {
add_tag => [ "GeoIPSyslog" ]
source => "destination"
}
dns {
add_tag => [ "DNSResolvDest" ]
reverse => [ "destination" ]
action => "replace"
}
dns {
add_tag => [ "DNSResolvSource" ]
reverse => [ "source" ]
action => "replace"
}
mutate {
convert => [ "tKbps5", "integer" ]
convert => [ "rKbps5", "integer" ]
convert => [ "tKbps30", "integer" ]
convert => [ "rKbps30", "integer" ]
convert => [ "timeAvg", "integer" ]
convert => [ "dPort", "integer" ]
convert => [ "sPort", "integer" ]
}
}
}
output {
stdout {}
elasticsearch {
host => "127.0.0.1"
protocol => "http"
}
}