Search code examples
grok

Simple GROK pattern for JAVA


Its weird that GROK pattern is not parsing the string :

org.dozer.config.GlobalSettings.loadGlobalSettings

%{JAVACLASS:class}\.%{JAVAMETHOD:method}

I see compile error. Please suggest.


Solution

  • Seems that JAVAMETHOD is not found, I didn't have time to check if was removed or what's going on with it, but here you can see how it is done

    So a quick work around is to create your own custom pattern

    JAVAMETHOD (?:(<(?:cl)?init>)|[a-zA-Z$_][a-zA-Z$_0-9]*)
    

    After that this works

    example