Skip to content

Instantly share code, notes, and snippets.

@sebastianwebber
Last active October 7, 2015 03:08
Show Gist options
  • Save sebastianwebber/f53c46762b62d50a1f84 to your computer and use it in GitHub Desktop.
Save sebastianwebber/f53c46762b62d50a1f84 to your computer and use it in GitHub Desktop.
JBoss/Wildfly server.log REGEX sheet cheat

JBoss/Wildfly server.log REGEX sheet cheat

Summary

'(WARN|ERROR)[ ]{1,}\[[\.a-z0-9A-Z]{1,}\]'

egrep sample:

egrep '(WARN|ERROR)[ ]{1,}\[[\.a-z0-9A-Z]{1,}\]' -o server.log

To summarize, its necessary make uniq count the rows, to do that, its necessary sort them first (with the sort command). Finnaly sort it by total (with the -gr parameters) and get the top 10 with head (and the -n 10 parameter):

egrep '(WARN|ERROR)[ ]{1,}\[[\.a-z0-9A-Z]{1,}\]' -o server.log | sort | uniq -ic | sort -gr | head -n 10
[root@jboss-server log]# egrep '(WARN|ERROR)[ ]{1,}\[[\.a-z0-9A-Z]{1,}\]' -o server.log | sort | uniq -ic | sort -gr | head -n 10
19680 WARN [org.jboss.ws.metadata.wsdl.WSDLDefinitions]
16587 ERROR [STDERR]
15940 WARN [org.ajax4jsf.renderkit.AjaxRendererUtils]
14682 ERROR [br.com.foo.exception.ExceptionHandler]
14074 WARN [org.ajax4jsf.context.AjaxContext]
10274 WARN [com.arjuna.ats.jta.logging.loggerI18N]
9832 WARN [eu.medsea.mimeutil.MimeDetectorRegistry]
8683 WARN [br.cliente.site.ABC.business.dao.ParametroDAO]
1633 ERROR [org.jboss.seam.exception.Exceptions]
233 ERROR [br.com.super.package.actions.anexarDocumentos.AnexarDocumentos]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment