thekrakken / java-grok

Simple API that allows you to easily parse logs and other files
http://grok.nflabs.com/
Other
358 stars 152 forks source link

Match#capture: flatten multiple values to the same key #68

Closed retoo closed 7 years ago

retoo commented 7 years ago

Sometimes there are multiple ways a key can be captured. With 0.1.5 I get a list of the value and null. The new capturesFlattened cleans up multiple values as long as there is only one non-null value.

@anthonycorbacho I don't know if you like the additional capture Method. Or if you would prefer an option for the grok/matcher object itself? And what do you think about the exception, I'd like to warn the user about an ambiguity.

anthonycorbacho commented 7 years ago

@retoo nahh, i am okay with your change, look pretty good.

Thanks for your contribution :)

i will merge it by tomorrow.

retoo commented 7 years ago

Cool!

Sorry there was some stuff remaining from another approach. I removed the unused code.