Hello, I am trying to extract the message part of the event below which starts at "Not able to... " without having to use multiple %{+error_message} fields but only a single field. Is that possible?
17.01.2019 17:16:23.175 WARN [10.43.32.119 [1547745383173] GET /content/regent.html HTTP/1.1] com.adobe.fd.core.security.internal.CurrentUserServiceImpl Not able to find user for userId [anonymous]
my LS config file looks like this and it works but trying to be more efficient with less lines in my code.
input {
file {
path => "/root/logstash/aemlog"
sincedb_path => "/dev/null"
start_position => "beginning"
}
}
filter {
dissect {
mapping => {
"message" => "%{syslog_timestamp} %{+syslog_timestamp} %{severity} [%{ip} %{?skip1} %{method} %{file} %{version}] %{?skip2} %{error_message} %{+error_message} %{+error_message} %{+error_message} %{+error_message} %{+error_message} %{+error_message} [%{username}] "
}
}
}
The output looks like:
"error_message" => "Not able to find user for userId",
"severity" => "WARN",
"method" => "GET",
"ip" => "10.43.32.13",
"version" => "HTTP/1.1",
"file" => "/content/regent.html",
"syslog_timestamp" => "17.01.2019 17:16:13.135",
"username" => "anonymous]"
Thank you