# Logstash - add new field under array of json objects

**URL:** https://discuss.elastic.co/t/logstash-add-new-field-under-array-of-json-objects/94704
**Category:** Logstash
**Created:** [July 26, 2017, 8:27pm UTC](https://discuss.elastic.co/t/logstash-add-new-field-under-array-of-json-objects/94704 "2017-07-26T20:27:14Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![prasperl](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@prasperl](https://discuss.elastic.co/u/prasperl)
#### Post date: [July 26, 2017, 8:27pm UTC](https://discuss.elastic.co/t/logstash-add-new-field-under-array-of-json-objects/94704/1 "2017-07-26T20:27:14Z")

</div>

I have a JSON input as given below

```
{ 
"id":4,
"locale":"en",
"restaurants": [ 
    { "addressLine" : "123 Road Dr", "city" : "City ST", "phone" : "555-555-5555", "distance" : "0" } , 
    { "addressLine" : "456 Fake St", "city" : "City ST", "phone" : "555-123-1212", "distance" : "0" } 
] }

```

Here I want to concatenate "addressLine" and "City"to new field called "fulladdress" under each object in "restaurant" array

I tried mutate,ruby filters but looks like I am missing something.

In case of a simple json,mutate add\_field works perfectly

Please help

---

<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: [August 23, 2017, 8:27pm UTC](https://discuss.elastic.co/t/logstash-add-new-field-under-array-of-json-objects/94704/2 "2017-08-23T20:27:37Z")

</div>

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