Hi - i am trying to parse the below log file:
[2018-05-29 08:04:23,687] DEBUG - http-outgoing-2845 << HTTP/1.1 500 Internal Server Error {org.apache.synapse.transport.http.headers}
[2018-05-29 08:04:18,037] DEBUG - http-outgoing-2842 << HTTP/1.1 200 OK {org.apache.synapse.transport.http.headers}
below is my conf
input {
file {
path => "/home/abhi/ipclick.log"
start_position=> "beginning"
}
}
filter {
grok {
break_on_match => false
match =>
{'message' => ['%{SYSLOG5424SD:date} DEBUG - http-outgoing%{BASE16FLOAT:outputid} << HTTP%{URIPATHPARAM:URL} 500 %{GREEDYDATA:STATUS} {%{JAVACLASS:MSG}}','%{SYSLOG5424SD:date} DEBUG - >> %{QS:STATUS} {%{JAVACLASS:MSG}}','%{SYSLOG5424SD:date} DEBUG - http-outgoing%{BASE16FLOAT:outputid} >> %{GREEDYDATA: request} %{URIPATHPARAM:URL} {%{JAVACLASS:MSG}}'
,'%{SYSLOG5424SD:date} DEBUG - http-outgoing%{BASE16FLOAT:outputid} << HTTP%{URIPATHPARAM:URL} 200 %{GREEDYDATA:STATUS} {%{JAVACLASS:MSG}}']}
}
#if "_grokparsefailure" in [tags] {
drop{}
#}
}
output {
elasticsearch {
hosts => "XXXXX:9200"
index => "log"
}
stdout {
codec => rubydebug
}
}
I get the below output: [even though my message pattern is same for output 1 & 2, my second output parses the value but with a _grokparsefailure issue.
grok filter pattern that i have used in both the cases are same. Any help will be appreciated..
{
"URL" => "/1.1",
"path" => "/home/abhi/ipclick.log",
"MSG" => "org.apache.synapse.transport.http.headers",
"host" => "SCPUBU",
"date" => "[2018-05-29 08:04:18,037]",
"outputid" => "-2842",
"message" => "[2018-05-29 08:04:18,037] DEBUG - http-outgoing-2842 << HTTP/1.1 200 OK {org.apache.synapse.transport.http.headers}",
"STATUS" => "OK",
"@timestamp" => 2018-07-03T09:59:22.087Z,
"@version" => "1"
}
{
"URL" => "/1.1",
"outputid" => "-2845",
"date" => "[2018-06-29 08:04:23,687]",
"message" => "[2018-06-29 08:04:23,687] DEBUG - http-outgoing-2845 << HTTP/1.1 500 OK {org.apache.synapse.tranr}",
"@timestamp" => 2018-07-03T09:59:22.086Z,
"@version" => "1",
"MSG" => "org.apache.synapse.tranr",
"path" => "/home/abhi/ipclick.log",
"host" => "SCPUBU",
"STATUS" => "OK",
"tags" => [
[0] "_grokparsefailure"
]
}