How to convert HEXA field into ASCII field through logstash pipeline

Hi All,
we are getting one filed in the form of hexa i need to convert that filed into ASCII through logstash pipeline. Could you please guide me on this?
eg:- "abc": "8a64756c656173654368616e"
I need to convert "abc" field value into ASCII.
Thanks

Hi,

you can use the Ruby filter plugin

Example:

filter {
  ruby {
    code => "
      field_value = event.get('abc')
      if field_value
        ascii_value = [field_value].pack('H*')
        event.set('abc', ascii_value)
      end
    "
  }
}

Regards

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.