sematext / logagent-js

Extensible log shipper with input/output plugins, buffering, parsing, data masking, and small memory/CPU footprint
https://sematext.com/logagent
Apache License 2.0
389 stars 79 forks source link

Add Java Garbage Collection parser #161

Open otisg opened 5 years ago

otisg commented 5 years ago

Note that different JVMs have different GC log patterns. We could pick a few from the most popular JVMs/versions.

prog8 commented 5 years ago

JVM GC logs format depends not only on JVM version but also JVM settings used to start JVM.

We can look here to get inspirations: https://github.com/chewiebug/GCViewer/tree/develop/src/main/java/com/tagtraum/perf/gcviewer/imp

An example for G1 logs parser: https://github.com/chewiebug/GCViewer/blob/develop/src/main/java/com/tagtraum/perf/gcviewer/imp/DataReaderSun1_6_0G1.java

Notice that extracting valuable numeric data is not trivial but hopefully doable with simple JS regexps. @megastef could you take a quick look at the example of parser to see how much effort would it require on LA side to prepare regular expressions which can handle it?

This one also looks interesting. Maybe can be useful: https://github.com/Mortinke/logstash-pattern/blob/master/logstash/etc/logstash/patterns/gc

radu-gheorghe commented 5 years ago

Here's a sample G1 GC log from OpenJDK 11. Running Elasticsearch 7.0, though this shouldn't matter. gc.log

megastef commented 5 years ago

@radu-gheorghe would you like to try grok patterns https://github.com/Mortinke/logstash-pattern/blob/master/logstash/etc/logstash/patterns/gc together with Logagent grok input filter ?

radu-gheorghe commented 5 years ago

Will do. And get back to you.