I have logs of around thousand lines in a file, from which only three lines are useful for me. I am using grok filter to identify and filter those logs, now i want them to be in same document. How do i do that?
I am running it for similar multiple files. I find path is only common field for all three documents of a single log file.
`
{
"message" => "[INFO main : 10/08/2019-23:49:43.286 : EDeliveryProcessor] COBDate: 10/08/2019",
"@version" => "1",
"SLA_Start" => 2019-12-05T19:00:00.000Z,
"path" => "/opt/logstash/testlogs/runOfflinesC-DailyStmt.log",
"COBDate" => 2019-01-07T18:30:00.000Z,
"@timestamp" => 2019-12-06T10:35:58.510Z,
"host" => "sd-0153-fc25.nam.nsroot.net",
"sys" => "[INFO main : 10/08/2019-23:49:43.286 : EDeliveryProcessor]",
"SLA_End" => 2019-12-05T19:30:00.000Z
}
{
"message" => " Offline batch Start Time ->Oct 8, 2019 11:47:33 PM, End time ->Oct 8, 2019 11:49:43 PM",
"@version" => "1",
"Start Time" => 2019-10-08T18:17:33.000Z,
"path" => "/opt/logstash/testlogs/runOfflinesC-DailyStmt.log",
"SLA_Start" => 2019-12-05T19:00:00.000Z,
"End Time" => 2019-10-08T18:19:43.000Z,
"@timestamp" => 2019-12-06T10:35:58.509Z,
"host" => "sd-0153-fc25.nam.nsroot.net",
"SLA_End" => 2019-12-05T19:30:00.000Z
}
{
"message" => "[INFO main : 10/08/2019-23:49:43.286 : EDeliveryProcessor] Production-C:DAR:DailyStmt: EDeliveryDriver2 (10/08/2019) : Processed <176> Users <0> Jobs Failed",
"@version" => "1",
"SLA_Start" => 2019-12-05T19:00:00.000Z,
"path" => "/opt/logstash/testlogs/runOfflinesC-DailyStmt.log",
"date" => "10/08/2019",
"@timestamp" => 2019-12-06T10:35:58.510Z,
"host" => "sd-0153-fc25.nam.nsroot.net",
"sys" => "[INFO main : 10/08/2019-23:49:43.286 : EDeliveryProcessor]",
"Processed User" => 176,
"Failed User" => 0,
"SLA_End" => 2019-12-05T19:30:00.000Z
}