# Modifying Tags in nested JSON array

**URL:** <https://discuss.elastic.co/t/modifying-tags-in-nested-json-array/51716>\
**Category:** Logstash\
**Created:** [June 2, 2016, 3:13pm UTC](https://discuss.elastic.co/t/modifying-tags-in-nested-json-array/51716 "2016-06-02T15:13:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wmikew5672](https://avatars.discourse-cdn.com/v4/letter/w/58956e/32.png) [@wmikew5672](https://discuss.elastic.co/u/wmikew5672)\
**Post date:** [June 2, 2016, 3:13pm UTC](https://discuss.elastic.co/t/modifying-tags-in-nested-json-array/51716/1 "2016-06-02T15:13:43Z")

</div>

I'm looking to modify tags within a nested JSON array via a ruby filter. Basically, the log looks similar to the following:  
{  
“message” =\> “”,  
“@version =\> “1”,  
“@timestamp” =\> “2016-06-02T13:02:33.966Z”,  
“host” =\> “xxx.xx.xxx.xx”,  
“headers” =\> {  
“request\_method” =\> “GET”,  
“request\_path” =\> “/”,  
“request\_uri” =\> “/”,  
“http\_date” =\> “…  
}  
}

There are several keys within the "headers" nested array that begin with 'http\_', and also which have dots; ie: 'file.owner'. In short, I want to eliminate the 'http\_' part of the key, and sub an underscore for every '.'.

Is this possible in a ruby filter, or is there a better way to do it such as the translate plugin?

---

<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:** [June 14, 2016, 6:10pm UTC](https://discuss.elastic.co/t/modifying-tags-in-nested-json-array/51716/2 "2016-06-14T18:10:24Z")

</div>

The de\_dot filter should be able to help with the dots. Removing the "http\_" prefix is certainly possible with a ruby filter. Since this is an old post I won't spend time writing an example in case you've already solved it.

---

<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:** [July 6, 2017, 4:52am UTC](https://discuss.elastic.co/t/modifying-tags-in-nested-json-array/51716/3 "2017-07-06T04:52:59Z")

</div>

Closed on July 6, 2017, 4:52am UTC


