trying to parse a file with logstash.conf present in /usr/local/cellar/logstash/6.6.1/libexec/config directory, and i am running the command
logstash -f logstash.conf from bin folder. the logstash.conf file contents are.
input {
file {
path => "/usr/local/cellar/logstash/6.6.1/libexec/config/servicelog*"
start_position => "beginning"
sincedb_path => "/Users/yshb/"
codec => multiline {
pattern => "^EOE"
negate => "true"
what => "next"
}
}
}
filter {
mutate {
gsub => [
"message", "\n", ";"
]
}
kv {
allow_duplicate_values => false
field_split => ";"
value_split => "="
include_keys => [
"Ubid",
"PageLocale",
"ActionType",
"RequestId",
"StartTime",
"PID",
"CustomerId",
"WidgetName",
"Marketplace",
"Session",
"Time",
"program"
]
}
if [StatusCode] !~ /^5\d\d/ {
drop { }
}
date {
match => [ "StartTime", "UNIX" ]
}
}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "{{ servicelog }}"
}
stdout { codec => rubydebug }
}
the content of log files are mutiple entries of kv pairs where each entry ends with EOE. for eg.
name=elastic
lastname=search
EOE
name=logstash
lastname=whatever
EOE