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

**URL:** <https://discuss.elastic.co/t/ruby-exception-occurred-invalid-fieldreference-eventdata-logreferences/230558>\
**Category:** Logstash\
**Created:** [April 30, 2020, 1:25pm UTC](https://discuss.elastic.co/t/ruby-exception-occurred-invalid-fieldreference-eventdata-logreferences/230558 "2020-04-30T13:25:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abinash](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abinash/32/67434_2.png) [@Abinash](https://discuss.elastic.co/u/Abinash)\
**Post date:** [April 30, 2020, 1:25pm UTC](https://discuss.elastic.co/t/ruby-exception-occurred-invalid-fieldreference-eventdata-logreferences/230558/1 "2020-04-30T13:25:31Z")

</div>

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**

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

```

working script with 6.2.4 logstash

```auto
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.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [April 30, 2020, 2:28pm UTC](https://discuss.elastic.co/t/ruby-exception-occurred-invalid-fieldreference-eventdata-logreferences/230558/2 "2020-04-30T14:28:13Z")

</div>

> [@Abinash](#):
>
> event.get('eventData[logReferences]')

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

```
event.get('[eventData][logReferences]')

```

---

<div class="post-metadata">

**Author:** ![Abinash](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abinash/32/67434_2.png) [@Abinash](https://discuss.elastic.co/u/Abinash)\
**Post date:** [May 4, 2020, 12:17pm UTC](https://discuss.elastic.co/t/ruby-exception-occurred-invalid-fieldreference-eventdata-logreferences/230558/3 "2020-05-04T12:17:09Z")

</div>

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

Thank you 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 1, 2020, 12:17pm UTC](https://discuss.elastic.co/t/ruby-exception-occurred-invalid-fieldreference-eventdata-logreferences/230558/4 "2020-06-01T12:17:20Z")

</div>

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