I have written a conf file in logstash to read the jms log and the problems are I could not break the records into newlines fore filtering. Here is the raw data
####<Sep 20, 2015 12:00:12 AM> <> <1442678412960> <809000> <ID:<307061.1442678412716.0>> <> <CmsCorpAlsPrd_als_mod!CmsCorpAlsPrd_jmsAls_cdceap7e_32040@abb_audit_als_dQue> <Consumed> <<anonymous>> <MC:CA(local):OAMI(CmsCorpAlsPrd_cdceap7e_32040.jms.connection36.session121.consumer125)> <<?xml version="1.0" encoding="UTF-8"?>
<mes:WLJMSMessage xmlns:mes="http://www.bea.com/WLS/JMS/Message"><mes:Header><mes:JMSDeliveryMode>PERSISTENT</mes:JMSDeliveryMode><mes:JMSExpiration>0<> <> ####<Sep 20, 2015 12:00:13 AM> <> <1442678413018> <392000> <ID:<307061.1442678412943.0>> <> <CmsCorpAlsPrd_als_mod!CmsCorpAlsPrd_jmsAls_cdceap7e_32040@abb_audit_als_dQue> <Produced> <<anonymous>> <> <<?xml version="1.0" encoding="UTF-8"?>
<mes:WLJMSMessage xmlns:mes="http://www.bea.com/WLS/JMS/Message"><mes:Header><mes:JMSDeliveryMode>PERSISTENT</mes:JMSDeliveryMode><mes:JMSExpiration>0<> <>
And here is my conf file in logstash
input{
stdin{}
file{
type => "txt"
path => "C:\HA\jms\jms.log"
start_position => "beginning"
}
}
filter{
multiline{
pattern => "\&"
what => previous
}
grok{
match => {"message" => ['####<%{GREEDYDATA:Date}>%{SPACE}<>%{SPACE}<%{GREEDYDATA:Millisec_Date}>%{SPACE}<%{GREEDYDATA:Nanosec_Date}>%{SPACE}<ID:<%{GREEDYDATA:JMS_message_ID}>>%{SPACE}<>%{SPACE}<%{GREEDYDATA:JMS_destination_name}>%{SPACE}<%{GREEDYDATA:JMS_message_eventname}>%{SPACE}<<%{GREEDYDATA:JMS_username}>>%{SPACE}<%{GREEDYDATA:JMS_correlationID}>%{SPACE}<%{GREEDYDATA:Mcls}:JMSDeliveryMode>%{WORD:JMSDeliveryMode}</mes:JMSDeliveryMode><mes:JMSExpiration>%{NUMBER:JMSExpiration}<>%{SPACE}<>']}
}
}
output{
elasticsearch { hosts => ["localhost:9200"]
}
stdout { codec => rubydebug }
}
All the things went well except when I run the conf and the result gives me this
"@version" => "1",
"@timestamp" => "2016-06-08T06:23:50.543Z",
"path" => "C:\\HA\\jms\\jms.log",
"host" => "WIN-07LLQEN2SJB",
"type" => "txt",
"tags" => [
[0] "multiline"
],
"Date" => "Sep 20, 2015 12:00:12 AM> <> <1442678412960> <809000> <ID:<307061.1
442678412716.0>> <> <CmsCorpAlsPrd_als_mod!CmsCorpAlsPrd_jmsAls_cdceap7e_32040@abb_audit_als_dQue> <Consumed> <<anonymou
s>> <MC:CA(local):OAMI(CmsCorpAlsPrd_cdceap7e_32040.jms.connection36.session121.consumer125)> <<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n<mes:WLJMSMessage xmlns:mes=\"http://www.bea.com/WLS/JMS/Message\"><mes:Header><
mes:JMSDeliveryMode>PERSISTENT</mes:JMSDeliveryMode><mes:JMSExpiration>0<> <> \n####<
Sep 20, 2015 12:00:13 AM",
"Millisec_Date" => "1442678413018",
"Nanosec_Date" => "392000",
"JMS_message_ID" => "307061.1442678412943.0",
"JMS_destination_name" => "CmsCorpAlsPrd_als_mod!CmsCorpAlsPrd_jmsAls_cdceap7e_32040@abb_audit_als_dQue",
"JMS_message_eventname" => "Produced",
"JMS_username" => "anonymous",
"Mcls" => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<mes:WLJMSMessage xmlns:mes=\"http:
//www.bea.com/WLS/JMS/Message\"><mes:Header><mes",
"JMSDeliveryMode" => "PERSISTENT",
"JMSExpiration" => "0"
}
Obviously, the date has part has read all the data in first message and seem classified i as the data of the 2nd message. Is there anyway to solve this in breaking different records in new line?