Page 1 of 1

Grok pattern Nxlog configuration wildfly

PostPosted: Thu Jul 07, 2022 5:26 am
by vedat.matzir@hays.de
Hi community,
currently we are facing the issue to find a grok pattern for wildfly logs when there as a multiline entry like a stacktrace:

Example log entry:
2022-07-07 00:00:10,662 +0200 ERROR [EJB default - 5][or.jb.as.ej.timer:183] WFLYEJB0020: Error invoking timeout for timer: [id=xxxxxxxxxxxxxxxxxxxxxxxxxxxx timedObjectId=test-service-impl-2022.5.0.test-service-impl-2022.5.0.HomepageJobSchedulers auto-timer?:false persistent?:true timerService=org.jboss.as.ejb3.timerservice.TimerServiceImpl@586ssfsf previousRun=Wed Jul 06 20:00:00 CEST 2022 initialExpiration=null intervalDuration(in milli sec)=0 nextExpiration=Thu Jul 07 04:00:00 CEST 2022 timerState=IN_TIMEOUT info=de.scheduler.scheduled.homepage.jobassets.HomepageJobSchedulers] ScheduleExpression [second=0;minute=0;hour=*/4;dayOfMonth=*;month=*;dayOfWeek=1-5;year=*;timezoneID=null;start=null;end=null]: javax.ejb.EJBException: WFLYEJB0442: Unexpected Error
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:271)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:388)
Caused by: java.lang.NoClassDefFoundError: org/jsoup/Jsoup
.......

With online Grok debugger this: %{TIMESTAMP_ISO8601} %{ISO8601_TIMEZONE} %{LOGLEVEL} %{GREEDYDATA} is working fine, but when we insert the same pattern in nxlog configuration file it does not work.

Configuration to send to Nagios Logserver in Json:
<Input in>
Module im_file
File '%WILDFLY_LOG_DIR%\\server2.log'
<Exec>
log_debug($raw_event);
if match_grok($Message, "%{TEST_LOG}")
{
to_json();
}
else
{
log_info('Event did not match any pattern');
}
</Exec>
</Input>

Any help or ideas would be fine :D


Kind regards,
Vedat