-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlogstash-syslog.conf
65 lines (63 loc) · 2.28 KB
/
logstash-syslog.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
input {
file {
path => "/var/log/syslog"
start_position => beginning
type => "syslog"
}
}
filter {
if [type] == "syslog" {
grok {
match => {
"message" => "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: %{GREEDYDATA:syslog_message} %{IPV4:SrcIP}(:%{INT:SrcPort})? -> %{IPV4:DstIP}(:%{INT:DstPort})?"
}
}
grok {
match => {
"message" => "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: %{GREEDYDATA:syslog_message} %{IPV6:SrcIPv6}(:%{INT:SrcPort})? -> %{IPV6:DstIPv6}(:%{INT:DstPort})?"
}
}
grok {
match => {
"message" => "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: %{MONTHDAY:monthday}\-%{MONTH:month}\-%{YEAR:year} %{TIME:q_time} %{WORD:queries}\: %{WORD:info}\: %{WORD:client} \@%{WORD:id_word} %{IP:clientip}\#%{NUMBER:port} \(%{USERNAME:domain}\)\: %{WORD:view} %{WORD:external}\: %{WORD:query}\: %{USERNAME:domain_02} %{WORD:in} %{WORD:any} %{GREEDYDATA:lank} \(%{IP:ip_add}\)"
}
}
grok {
match => {
"message" => "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: %{GREEDYDATA:syslog_message}"
}
}
geoip {
source => "[SrcIP]"
target => "SrcGro"
}
geoip {
source => "[DstIP]"
target => "DstGro"
}
geoip {
source => "[SrcIPv6]"
target => "SrcGroIPv6"
}
geoip {
source => "[DstIPv6]"
target => "DstGroIPv6"
}
geoip {
source => "[clientip]"
target => "ClientIP"
}
date {
match => ["syslog_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss", "ISO8601"]
target => "@timestamp"
add_tag => ["tmatch"]
}
}
}
output {
elasticsearch {
hosts => ["http://localhost:9200"]
index => "index-syslog"
}
stdout {}
}