# How can I rename a dynamic nested field name

**URL:** <https://discuss.elastic.co/t/how-can-i-rename-a-dynamic-nested-field-name/75203>\
**Category:** Logstash\
**Created:** [February 15, 2017, 1:30pm UTC](https://discuss.elastic.co/t/how-can-i-rename-a-dynamic-nested-field-name/75203 "2017-02-15T13:30:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pbData](https://avatars.discourse-cdn.com/v4/letter/p/d2c977/32.png) [@pbData](https://discuss.elastic.co/u/pbData)\
**Post date:** [February 15, 2017, 1:30pm UTC](https://discuss.elastic.co/t/how-can-i-rename-a-dynamic-nested-field-name/75203/1 "2017-02-15T13:30:48Z")

</div>

I am currently looking at a camel project to get some stats from it. The following json response is what I get from jolokia. So I have a couple of issues I have to resolve although the most important is... I would like to rename the key "org.apache.camel:context=com.mycompany.component,name="component.route",type=routes" so that it is equal to "name=component.route". Note that this is nested too.

## example response

{  
"request": {  
"mbean": "org.apache.camel:context=_,name=_,type=routes",  
"type": "read"  
},  
"value": {  
"org.apache.camel:context=com.mycompany.component,name="component.route",type=routes": {  
"StatisticsEnabled": true,  
"EndpointUri": "cxfrs://bean:rsServer",  
"CamelManagementName": "com.ycompany.componentCntxt",  
"ExchangesCompleted": 2,  
"LastProcessingTime": 2069,  
"ExchangesFailed": 0,  
...  
}  
}  
}

Hope someone can help with this.

---

<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:** [February 18, 2017, 5:15pm UTC](https://discuss.elastic.co/t/how-can-i-rename-a-dynamic-nested-field-name/75203/2 "2017-02-18T17:15:02Z")

</div>

Just to point you in the right direction, you need to use a ruby filter for this.

---

<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:** [March 18, 2017, 5:15pm UTC](https://discuss.elastic.co/t/how-can-i-rename-a-dynamic-nested-field-name/75203/3 "2017-03-18T17:15:38Z")

</div>

Closed on March 18, 2017, 5:15pm UTC

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