# Rename json array field names

**URL:** https://discuss.elastic.co/t/rename-json-array-field-names/197903
**Category:** Beats
**Tags:** filebeat
**Created:** [September 3, 2019, 4:15pm UTC](https://discuss.elastic.co/t/rename-json-array-field-names/197903 "2019-09-03T16:15:49Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![vinshas1](https://avatars.discourse-cdn.com/v4/letter/v/3ec8ea/32.png) [@vinshas1](https://discuss.elastic.co/u/vinshas1)
#### Post date: [September 3, 2019, 4:15pm UTC](https://discuss.elastic.co/t/rename-json-array-field-names/197903/1 "2019-09-03T16:15:49Z")

</div>

{  
"Network IP Gateway": "165.10.2.3",  
"network details": [  
{  
"Adapter Name": "Intel(R) Network Connection",  
"Manufacturer": "Intel Corporation",  
"Adapter Type": "Ethernet 802.3",  
"MAC Address": "00:50:56:A3:2F:36",  
"Speed": "100 Mbps",  
"Network Connection ID": "Ethernet0"  
}  
]}

I am able to rename for eg: network details to network\_details but unable to rename the array fields for Eg: Adapter Name to adapter\_name.

Here is the filebeat config:

filebeat.inputs:

- type: log  
enabled: true  
paths:
  - /temp/sample.json  
#json.message\_key: event  
json.keys\_under\_root: true  
json.add\_error\_key: true

processors:

- drop\_fields:  
fields: ["@metadata", "prospector","input","beat","host","source","offset","log"]
- decode\_json\_fields:  
fields: ["message"]  
#process\_array: true  
#max\_depth: 100
- rename:  
fields:
  - from: "network details"  
to: "network\_details"
  - from: "Adapter Name"  
to: "adapter\_name"

---

<div class="post-metadata">

### Author: ![vinshas1](https://avatars.discourse-cdn.com/v4/letter/v/3ec8ea/32.png) [@vinshas1](https://discuss.elastic.co/u/vinshas1)
#### Post date: [September 5, 2019, 3:08am UTC](https://discuss.elastic.co/t/rename-json-array-field-names/197903/2 "2019-09-05T03:08:11Z")

</div>

any ideas.

---

<div class="post-metadata">

### Author: ![vinshas1](https://avatars.discourse-cdn.com/v4/letter/v/3ec8ea/32.png) [@vinshas1](https://discuss.elastic.co/u/vinshas1)
#### Post date: [September 10, 2019, 4:51pm UTC](https://discuss.elastic.co/t/rename-json-array-field-names/197903/3 "2019-09-10T16:51:42Z")

</div>

I have noticed java script processor but not sure what code to put in which servers my purpose.

---

<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: [October 11, 2019, 7:13pm UTC](https://discuss.elastic.co/t/rename-json-array-field-names/197903/5 "2019-10-11T19:13:19Z")

</div>

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