Extract a substring and assign to new field

Hi everyone!
Hope everyone's good.

in my application, i'm sending a JSON wich has a string field always made of 16 char
For example: XXXYYY12Y00K111H

Is there a fine way, or do you have any particular hint to extract, for example, the number 12, and assign it to a new field?

Thank you for any reply!

You can use grok

grok { match => { "someField" => "^.{6}(?<anotherField>..)" } }

will extract the seventh and eighth characters from a string.


This actually worked quite good, and with some adaptation also for other things :slight_smile:

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