I wish to parse the tomcat logs. But I am facing problem in multiline handling in Filebeat. The logs are not parsed as per the requirement. Getting grokparse failures. Upon checking, I could see that the line starts doesn't with the date are not appended to the lines starts with the date.
We are using the following multiline settings
- type: log
multiline.pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}|^[0-9]{2}-[A-z]{3}-[0-9]{4}|^[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}'
multiline.negate: true
multiline.match: after
The log file of the following format :
23-Oct-2018 13:19:41.677 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.5.11
23-Oct-2018 13:19:41.757 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Jan 10 2017 21:02:52 UTC
2018-10-23 15:00:21.464 http-nio-8085-exec-22 o.h.engine.loading.internal.CollectionLoadContext
15:00:21.464 http-nio-8085-exec-22 o.h.engine.loading.internal.CollectionLoadContext
According the multiline settings the message either starts with "Year-month-monthday", "Monthday-month-year" or "Hour:minute:seconds".
But the messages starts with the folliowing :
"message" => "\t\t\t\tbegin",
"message" => "\t\t\t\tselect nextval ('audit_trail_id_seq')",
"message" => "Hibernate: select nextval ('audit_trail_id_seq')",
"message" => "\t\t\t\tSequence value obtained: 97451",
"message" => "\t\t\t\tGetting ready to invoke write method on the destination object. Dest Obj: ActionEntity, Dest value: Fetch ticket count Success USER ID=69"
"message" => "\t\t\t\tResult set row: 49",
"message" => "\t\t\t\tResult row: ",
The line starts doesn't with the date are not appended to the lines starts with the date and time.
I have tried with the following multiline settings. Accoring to the setings the message starts with space,message starts with space,messgage starts with single white space character. This includes space, tab etc, messgage starts with at and messgage starts with should be appended to the line which doesn’t match the pattern.
multiline.pattern: '^[[:space:]]+(at|\.{3})\b|^Caused by:|^[[:space:]]|^\s'
multiline.negate: false
multiline.match: after
But still the issue is not resolved. Getting the following message :
"message" => "\t\t\t\tbegin",
"message" => "\t\t\t\tselect nextval ('audit_trail_id_seq')",
"message" => "Caused by: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: x.x.x.x, 25; timeout -1",
Please let us know what is the error with multiline pattern which we are using. Awaitng the reply.