I have a log file which contains a timestamp and logs message as shown below:
I need one multiple pattern such that if the line does not start with the timestamp it should be joined with the preceding line. Can anyone post me how input plugin should be written for this scenario.
Here is my log message:
10-05-2018 00:00:00.0031 DEBUG Thd: 6540 [Schedule] (checkSchedules) Chequea a: 10/05/2018 12:00:00 AM ON 10/05/2018 12:00:00 AM
10-05-2018 00:00:00.0031 DEBUG Thd: 6540 [Schedule] (checkSchedules) ThreadFinished: 00:00:00
10-05-2018 00:00:01.1904 ERROR Thd: 6568 192.168.56.1 [ManagedObject] (EntityLoad) Object not be loaded 192.168.56.1 AGENT
Adecef.TelgatNGOSS.ObjectServer.ManagedObjectException: instance does not exists
at Adecef.TelgatNGOSS.ObjectServer.ManagedObject.EntityLoad()
10-05-2018 00:00:01.1904 ERROR Thd: 6568 [ObjectServer] (GetManagedObject) Object can not be load: 192.168.56.1
Adecef.TelgatNGOSS.ObjectServer.ManagedObjectException: instance does not exists
at Adecef.TelgatNGOSS.ObjectServer.ManagedObject.EntityLoad()
at Adecef.TelgatNGOSS.ObjectServer.MAgentObject.EntityLoad()
at Adecef.TelgatNGOSS.ObjectServer.ObjectFactory.GetManagedObject(String oid, String objectClass, Boolean isFromWeb)
10-05-2018 00:00:01.2373 ERROR Thd: 6568 [ObjectServer] (processEvent) Exception Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
at Adecef.TelgatNGOSS.ObjectServer.EventReportManager.processEvent(Object taskInfo)
10-05-2018 00:00:08.6432 ERROR Thd: 6568 192.168.56.1 [ManagedObject] (EntityLoad) Object not be loaded 192.168.56.1 AGENT
Adecef.TelgatNGOSS.ObjectServer.ManagedObjectException: instance does not exists
at Adecef.TelgatNGOSS.ObjectServer.ManagedObject.EntityLoad()
10-05-2018 00:00:08.6432 ERROR Thd: 6568 [ObjectServer] (GetManagedObject) Object can not be load: 192.168.56.1
Adecef.TelgatNGOSS.ObjectServer.ManagedObjectException: instance does not exists
at Adecef.TelgatNGOSS.ObjectServer.ManagedObject.EntityLoad()
at Adecef.TelgatNGOSS.ObjectServer.MAgentObject.EntityLoad()
at Adecef.TelgatNGOSS.ObjectServer.ObjectFactory.GetManagedObject(String oid, String objectClass, Boolean isFromWeb)
10-05-2018 00:00:09.5814 ERROR Thd: 6568 [ObjectServer] (processEvent) Exception Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
at Adecef.TelgatNGOSS.ObjectServer.EventReportManager.processEvent(Object taskInfo)
10-05-2018 00:00:11.2221 ERROR Thd: 7156 192.168.56.1 [ManagedObject] (EntityLoad) Object not be loaded 192.168.56.1 AGENT
Adecef.TelgatNGOSS.ObjectServer.ManagedObjectException: instance does not exists
at Adecef.TelgatNGOSS.ObjectServer.ManagedObject.EntityLoad()
I have used multiline codec, but its not working as expected, I mean it is taking all lines between two lines, only it is taking 2 or 3 lines. And remaining lines are going with next event.
Please show an example of the input and the resulting events. Use a stdout { codec => rubydebug } output to dump the raw events and make sure you format the example input as preformatted text.
2018-05-10 00:00:00.0031 DEBUG Thd: 6540 [Schedule] (checkSchedules) Chequea a: 10/05/2018 12:00:00 AM ON
2018-05-10 00:00:00.0031 DEBUG Thd: 6540 [Schedule] (checkSchedules) ThreadFinished: 00:00:00
2018-05-10 00:00:01.1904 ERROR Thd: 6568 192.168.56.1 [ManagedObject] (EntityLoad) Object not be loaded 192.168.56.1 AGENT
Adecef.TelgatNGOSS.ObjectServer.ManagedObjectException: instance does not exists
at Adecef.TelgatNGOSS.ObjectServer.ManagedObject.EntityLoad()
2018-05-10 00:00:01.1904 ERROR Thd: 6568 [ObjectServer] (GetManagedObject) Object can not be load: 192.168.56.1
Adecef.TelgatNGOSS.ObjectServer.ManagedObjectException: instance does not exists
at Adecef.TelgatNGOSS.ObjectServer.ManagedObject.EntityLoad()
at Adecef.TelgatNGOSS.ObjectServer.MAgentObject.EntityLoad()
at Adecef.TelgatNGOSS.ObjectServer.ObjectFactory.GetManagedObject(String oid, String objectClass, Boolean isFromWeb)
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.