Save a value to variable

Hi All,

Please suggest If it is possible to do a grok & perform a mathematical operation on grok result?


I do that.. by using the ruby filter (and then do it in ruby :slight_smile:

Hey Klavs,

Thank you for the update.
I have not done it before , could you please post some snippet of logstash config file or any specific link to the same.
It would be great help.

Thank you.

Will give you a sha1 has of 'message' field - and add field called message_id containing the result (which I then use in my output to ES as document_id).

code section is pure ruby - and has access to parts of the current logline being processed through event.

filter {
ruby {
init => "require 'digest/sha1'"
code => "event['message_id'] = Digest::SHA1.base64digest(event['message'])"

Thank you .
I am trying to implement on my problem statement.