I have seen Grok being very strong and lethal in parsing the log data. I wanted to use Grok for log parsing in our application, which is in java.. How can i connect/work with Grok from Java.?
相关问题
- Correctly parse PDF paragraphs with Python
- R: eval(parse()) error message: cannot ope
- How do I parse a .pls file using PHP? Having troub
-
Create array from the contents of 相关文章
- How do I get from a type to the TryParse method?
- Slow ANTLR4 generated Parser in Python, but fast i
- Parsing JSON in QML [duplicate]
- How do I generate an AST from a string of C++ usin
- JSoup will not fetch all items?
- Content is not allowed in prolog
- How to manage parsing an null object for DateTime
- Make Gson throw exception on parsing JSON with dup
Check out this Java library
https://github.com/aicer/grok
You can include it in your project as a maven dependency
It comes with pre-defined patterns and you can also add yours.
The named patterns are extracted and the results are available in a map with the groups names as the keys and the retrieved values are mapped to these keys.
This next examples adds string patterns directly to the dictionary without using a file
Here is a complete example of how to use the library
Try downloading java-grok from GitHub: https://github.com/NFLabs/java-grok You can test patterns using the Grok Debugger: http://grokdebug.herokuapp.com/