-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogstash.conf
64 lines (63 loc) · 1.87 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
input {
tcp {
port => 9000
type => syslog
}
udp {
port => 9000
type => syslog
}
}
filter {
if [type] == "syslog" {
grok {
match => { "message" => "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{WORD:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: %{GREEDYDATA}:message" }
overwrite => "message"
add_tag => [ "SYSLOG" ]
add_field => [ "received_at", "%{@timestamp}" ]
add_field => [ "received_from", "%{host}" ]
}
}
if "_grokparsefailure" in [tags] {
grok {
patterns_dir => "/etc/logstash/patterns"
match => [ "message", "%{OPENSTACK}" ]
overwrite => "message"
add_field => [ "syslog_message", "%{message}" ]
add_tag => [ "openstack" ]
remove_tag => "_grokparsefailure"
}
}
if "_grokparsefailure" in [tags] {
grok {
patterns_dir => "/etc/logstash/patterns"
match => [ "message", "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{TIMESTAMP_ISO8601:logdate} %{PROG:syslog_pid} %{WORD:auditlevel} %{PROG:syslog_program} \[.*\] %{GREEDYDATA:message}" ]
overwrite => "message"
add_tag => [ "swift1" ]
remove_tag => "_grokparsefailure"
}
}
if "_grokparsefailure" in [tags] {
grok {
patterns_dir => "/etc/logstash/patterns"
match => [ "message", "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: %{GREEDYDATA:message}" ]
overwrite => "message"
add_field => [ "syslog_message", "%{message}" ]
add_tag => [ "swift2" ]
remove_tag => "_grokparsefailure"
}
}
if "_grokparsefailure" in [tags] {
grok {
patterns_dir => "/etc/logstash/patterns"
match => [ "message", "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}: %{GREEDYDATA:message}" ]
overwrite => "message"
add_tag => [ "swift3" ]
remove_tag => "_grokparsefailure"
}
}
}
output {
elasticsearch { host => elas }
stdout { codec => rubydebug }
}