As we known, the function back trace are constiuted by several hexadecimal number group, every group should be included 8 hex numbers. but some of them are missing one space that result 16 hex numbers are in one group.
I use GROK plugin to add a field which named "fcn", such liks this:
Judging by your example, you actually need to insert characters at some point in the string and otherwise capture the field as-is. That would be hard or messy to do with grok + some other method.
The best option I think would be some custom Ruby code, e.g.
Thanks a lot for your help, which make me understand to use ruby code to realize my object.
But actually my input message include a lot of other information, such as process name, service name and so on, there are included a lot of useful space. which shows as below:
You can use any other method to extract the fields, like grok, which will result in a malformed fcn field. Then use the above Ruby code on that field to fix it's format.
I want to use your ruby code to handle my log event, but I want only handle the function trace part, and firstly I have parsed the message by grok plugin:
The sub pattern shows as below:
How can I only get the fcn part from message in ruby code? can you make a example? because in the below code you will get all the message content, delete the space will impact other parts.
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.