Ruby exception occurred: Invalid FieldReference: `eventData[logReferences]`

There was issue with lagstash version 7.X version on words.
But the my logstash script worked with 6.2.4 with out this kind of this error.

Input

{
   "Versions": {
          "0.1": {
                 "eventData": {
                  "confidenceLevels": {
                            "subflow_nsa_fra": "FAILURE"
                    },
                   "logReferences": {},
                }
        }
}
}

working script with 6.2.4 logstash

filter {
      ruby{
           code => "
                begin	   
      event.set('eventData[logReferences]',event.get('eventData[logReferences]').to_s)
        end
       "
       }
}

Here we are trying to get the logreference and making it as string, and it is working with logstash 6.2.4 , but the script is not working with 7.X version onwards.

Any help would be appreciated.

I would expect that to get an ambiguous field reference error. Try

event.get('[eventData][logReferences]')
1 Like

I tried with that, It is working, I thought it would be only for json array.

Thank you :slight_smile: