# Suricata dashboard on 5.0 - Ruby issue

**URL:** <https://discuss.elastic.co/t/suricata-dashboard-on-5-0-ruby-issue/66946>\
**Category:** Logstash\
**Created:** [November 23, 2016, 6:03am UTC](https://discuss.elastic.co/t/suricata-dashboard-on-5-0-ruby-issue/66946 "2016-11-23T06:03:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick\_Minter](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nick_minter/32/13360_2.png) [@Nick\_Minter](https://discuss.elastic.co/u/Nick_Minter)\
**Post date:** [November 23, 2016, 6:03am UTC](https://discuss.elastic.co/t/suricata-dashboard-on-5-0-ruby-issue/66946/1 "2016-11-23T06:03:31Z")

</div>

Hi All,

On the new version of Logstash the ruby field references have changed.

As such the ruby code in the Logstash config here:  
[https://redmine.openinfosecfoundation.org/projects/suricata/wiki/\_Logstash\_Kibana\_and\_Suricata\_JSON\_output](https://redmine.openinfosecfoundation.org/projects/suricata/wiki/_Logstash_Kibana_and_Suricata_JSON_output)

No longer works with the latest version.

The code is:  
"if event['event\_type'] == 'fileinfo'; event['fileinfo']['type']=event['fileinfo']['magic'].to\_s.split(',')[0]; end;"

Which i modified to be:  
"if event.get('event\_type') == 'fileinfo'; event.set('fileinfo''type')=event.get('fileinfo''magic').to\_s.split(',')[0]; end;"

Which causes Logstash to go into a reboot loop.

Having not touched ruby at all ever, can anyone see what I'm doing wrong here?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [November 27, 2016, 8:25pm UTC](https://discuss.elastic.co/t/suricata-dashboard-on-5-0-ruby-issue/66946/2 "2016-11-27T20:25:52Z")

</div>

You're using the wrong syntax to reference nested fields. See [https://www.elastic.co/guide/en/logstash/current/event-api.html](https://www.elastic.co/guide/en/logstash/current/event-api.html) for details and examples.

---

<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:** [December 25, 2016, 8:26pm UTC](https://discuss.elastic.co/t/suricata-dashboard-on-5-0-ruby-issue/66946/3 "2016-12-25T20:26:05Z")

</div>

Closed on December 25, 2016, 8:26pm UTC

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