-
Notifications
You must be signed in to change notification settings - Fork 8
/
shipper.conf
86 lines (85 loc) · 2.5 KB
/
shipper.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
input {
tcp {
port => 10514
mode => "server"
tags => ['nova', 'oslofmt']
type => "nova"
}
tcp {
port => 11514
mode => "server"
tags => ['cinder', 'oslofmt']
type => "cinder"
}
tcp {
port => 12514
mode => "server"
tags => ['neutron', 'oslofmt']
type => "neutron"
}
tcp {
port => 13514
mode => "server"
tags => ['keystone', 'oslofmt']
type => "keystone"
}
tcp {
port => 14514
mode => "server"
tags => ['glance', 'oslofmt']
type => "glance"
}
# tcp {
# port => 1514
# mode => "server"
# tags => ['syslog']
# type => "syslog"
# }
}
filter {
if "oslofmt" in [tags]{
grok {
# Do multiline matching as the above mutliline filter may add newlines
# to the log messages.
# TODO move the LOGLEVELs into a proper grok pattern.
patterns_dir => "/logstash_patterns"
match => { "message" => "%{OPENSTACK_SYSLOGLINE}" }
add_field => { "received_at" => "%{@timestamp}" }
add_field => { "received_from" => "%{host}" }
add_field => { "_message" => "%{syslog5424_host} %{message}" }
}
if ("_grokparsefailure" not in [tags]){
syslog_pri {
severity_labels => ["EMERGENCY", "ALERT", "CRITICAL", "NOTICE", "ERROR", "INFO", "DEBUG" ]
syslog_pri_field_name => "syslog5424_pri"
}
mutate {
rename => ["msg", "message"]
rename => ["syslog5424_host", "host"]
remove_field => "syslog_ts"
remove_field => "syslog5424_pri"
remove_field => "os_message"
add_tag => ["processed", "openstack_syslog", "filter_10.32.105.107"]
}
}
} else if [type] == "syslog" {
grok {
#match => { "message" => "%{SYSLOG5424PRI:priority}%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: %{GREEDYDATA:syslog_message}" }
match => { "message" => "%{SYSLOG5424PRI:priority}%{TIMESTAMP_ISO8601:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: %{GREEDYDATA:syslog_message}" }
add_field => [ "received_at", "%{@timestamp}" ]
add_field => [ "received_from", "%{host}" ]
}
mutate {
add_tag => ["processed"]
}
}
}
output {
redis {
#data_type => "list"
data_type => "channel"
key => "logstash-*"
host => "broker01"
port => 6379
}
}