logstash-plugins / logstash-filter-mutate

Apache License 2.0
16 stars 75 forks source link

Error converting boolean values in Logstash 8.11.1: Can't modify frozen string #170

Closed edmocosta closed 1 year ago

edmocosta commented 1 year ago

Logstash information:

Logstash version (e.g. bin/logstash --version): 8.11.1

Description of the problem including expected versus actual behavior: The mutate filter throws an error (can't modify frozen String) when converting a boolean value into a string in Logstash 8.11.1. It seems to be related to the Ruby's change: https://bugs.ruby-lang.org/issues/16150.

Steps to reproduce

Run Logstash with the following pipeline:

    input { 
      generator {
        count => 1
        message => '{ "data": true }'
        codec => json
      } 
    }

    filter {
      json { source => "message" }
      mutate { "convert" => { "data" => "string" } }
    }

    output {
       stdout { codec => rubydebug { metadata => true } }
    }

Provide logs (if relevant):

[2023-11-22T10:31:40,964][WARN ][logstash.filters.mutate  ][test][67292f266c4fca48609a3e09ef25244e824940b8da72205243c1f3b9e448ecfb] Exception caught while applying mutate filter {:exception=>"can't modify frozen String"}