-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathlw_solr_syslog.conf
48 lines (43 loc) · 1.2 KB
/
lw_solr_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
input {
file {
type => "syslog"
exclude => ["*.gz","*.zip","*.tgz"]
# FYI - LogStash does not always recurse the directory hirearcy correctly on Windows
# unless the path is all lowercase.
path => [ "/var/log/system.log" ]
sincedb_path => "/dev/null"
start_position => "beginning"
}
}
# Add name=value pairs as fields
filter {
if [type] == "syslog" {
grok {
match => { "message" => "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}?: %{GREEDYDATA:syslog_message}" }
add_field => [ "received_at", "%{@timestamp}" ]
add_field => [ "received_from", "%{host}" ]
}
date {
match => [ "syslog_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss" ]
}
if !("_grokparsefailure" in [tags]) {
mutate {
replace => [ "source_host", "%{syslog_hostname}" ]
}
}
mutate {
remove_field => [ "syslog_hostname", "syslog_timestamp" ]
}
}
}
output {
lucidworks_solr {
collection_host => "localhost"
collection_port => "8983"
collection_name => "logstash_logs"
field_prefix => "event_"
force_commit => false
flush_size => 100
idle_flush_time => 1
}
}