Skip to content

Instantly share code, notes, and snippets.

@bencomp
Created August 1, 2014 15:50
Show Gist options
  • Save bencomp/9b99cee2720d6233c8a1 to your computer and use it in GitHub Desktop.
Save bencomp/9b99cee2720d6233c8a1 to your computer and use it in GitHub Desktop.
Grok patterns for Glassfish server.log and access.log
# Glassfish server.log format. May span multiple lines (e.g. Java stacktrace), so in logstash use with multiline codec/filter.
THREADNAME Thread-%{INT:threadnumberinname}
GLASSFISHTHREADS _ThreadID=%{INT:threadid};_ThreadName=%{THREADNAME};
GLASSFISHLOG \[#\|%{TIMESTAMP_ISO8601:timestamp}\|%{LOGLEVEL:loglevel}\|%{DATA:application}\|%{GREEDYDATA:component}\|%{GLASSFISHTHREADS:threadinfo}\|%{GREEDYDATA:message}\|#\]
# Glassfish access.log format
GLASSFISHACCESS "%{IPORHOST:clientip}" "%{USER:auth}" "%{HTTPDATE:timestamp}" "(?:%{WORD:verb} %{SESSIONREQUEST:request}(?: HTTP/%{NUMBER:httpversion})?|%{DATA:rawrequest})" %{NUMBER:response} (?:%{NUMBER:bytes}|-)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment