hi guys, I want to parse the value like 'ABC_100', and I am trying to use the custom pattern as this: ALPHANUM %{WORD}_%{NUMBER}
When I use the GROK pattern in the filter as %{ALPHANUM:alphanumber}, it is not parsed, but if I use '%{WORD}_%{NUMBER}' directly in GROK filter, ABC_100 can be parsed into WORD and NUMBER respectively.
My question is: can I define a custom pattern name to represent %{WORD}_%{NUMBER}?
The problem is that WORD matches \b\w+\b, and \w matches letters, numbers, and underscore, so WORD consumes the entire message, leaving nothing for the _ and NUMBER to match. If you replace _ with = in both message and pattern it will match.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.