Message size added as Attribute

Hi,

I want to add the size in Bytes of a message to as an attribute of that message, is this possible? I have seen a some try this before with the ruby plugin, but I have been unable to get this to work.

Thanks in advance!

Try this one

filter {
    ruby {
        code => "event.set('message_size', event.get('message').bytesize)"
    }
}
2 Likes

Thanks a ton, I was working with length and I couldn't get it to work. This works perfectly.

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