# Set "fields" into array - SOLVED

**URL:** <https://discuss.elastic.co/t/set-fields-into-array-solved/73995>\
**Category:** Logstash\
**Created:** [February 5, 2017, 9:25pm UTC](https://discuss.elastic.co/t/set-fields-into-array-solved/73995 "2017-02-05T21:25:33Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![adrianolimit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adrianolimit/32/11930_2.png) [@adrianolimit](https://discuss.elastic.co/u/adrianolimit)\
**Post date:** [February 6, 2017, 9:10am UTC](https://discuss.elastic.co/t/set-fields-into-array-solved/73995/3 "2017-02-06T09:10:17Z")

</div>

Hello Magnus,

I tried your solution :

`event.set("[entities][hashtags][#{hash}][#{key}]", value.downcase)`

And I obtained this error message :

`[ERROR][logstash.filters.ruby] Ruby exception occurred: For input string: "{"indices"=>"`

I don't understand because in my filter I test if "k == text" before to try to set the value :

```
event.get("[entities][hashtags]").each {|hash|
	hash.each { |key,value|
		if key == "text"
			event.tag(value.downcase)
			event.set("[entities][hashtags][#{hash}][#{key}]", value.downcase)
		end
	}
}'

```

Do you have any idea?

---

_[View the full topic](https://discuss.elastic.co/t/set-fields-into-array-solved/73995)._
