# Keeping global variables in LS?!

**URL:** <https://discuss.elastic.co/t/keeping-global-variables-in-ls/39908>\
**Category:** Logstash\
**Created:** [January 22, 2016, 5:21pm UTC](https://discuss.elastic.co/t/keeping-global-variables-in-ls/39908 "2016-01-22T17:21:41Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![Samir\_Rahman](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@Samir\_Rahman](https://discuss.elastic.co/u/Samir_Rahman)\
**Post date:** [July 1, 2016, 5:09pm UTC](https://discuss.elastic.co/t/keeping-global-variables-in-ls/39908/18 "2016-07-01T17:09:22Z")

</div>

Hello, I am trying to achieve the same thing you guys are talking about, but when I try to do event['fieldName'] I get the following error:

:message=\>"Ruby exception occurred: undefined method `[]'

Did you guys encounter this? It seems like the documentation indicates that I should be able to access the fields like this.

---

_[View the full topic](https://discuss.elastic.co/t/keeping-global-variables-in-ls/39908)._
