Hi guys,
I have the next error on a ruby filter. I'd really appreciate any suggest
[2021-04-16T11:28:06,202][ERROR][logstash.filters.ruby ][main-postilion-pipeline][87afa373e1d0191b4f869238d2908162c237ad31fe6074ec0a41fc36d14eb8fa] Ruby exception occurred: undefined method `size' for nil:NilClass
Here's my pipeline filter
> ruby {
>
> code => "
>
> event.set('msg1Lenght', event.get('msg-1').size)
>
> event.set('msg2Lenght', event.get('msg-2').size)
>
> "
>
> }
>
>
> if [msg1Lenght] < 6 {
>
> mutate {
>
> update => { "msg-1" => "No se encontraron datos en el mensaje." }
>
> }
>
> }
>
> if [msg2Lenght] < 6 {
>
> mutate {
>
> update => { "msg-2" => "No se encontraron datos de detalle en el mensaje." }
>
> }
>
>
> }