Adding characters to a field

I have this value in a field:

881908396bfd

I want to format it like this:

88:19:08:39:6b:fd

What's the "best" way to do that?

if [someFieldName] =~ /^[0-9a-z]{12}$/ {
    mutate { gsub => [ "someFieldName", "^([0-9a-z][0-9a-z])([0-9a-z][0-9a-z])([0-9a-z][0-9a-z])([0-9a-z][0-9a-z])([0-9a-z][0-9a-z])([0-9a-z][0-9a-z])", "\1:\2:\3:\4:\5:\6" ] }
}

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