# JSon Array parsing - Field name

**URL:** https://discuss.elastic.co/t/json-array-parsing-field-name/32870
**Category:** Logstash
**Created:** [October 23, 2015, 4:43pm UTC](https://discuss.elastic.co/t/json-array-parsing-field-name/32870 "2015-10-23T16:43:33Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![apoc](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@apoc](https://discuss.elastic.co/u/apoc)
#### Post date: [October 23, 2015, 4:43pm UTC](https://discuss.elastic.co/t/json-array-parsing-field-name/32870/1 "2015-10-23T16:43:33Z")

</div>

Hi,

I manage to parse JSON array with logstash (Returns/Row)  
My configuration is

> ...  
> filter {  
> split {  
> field =\> "Returns[Row]"  
> add\_field =\> ["name" , "%{Returns.Row.name}"]  
> }  
> }  
> output {  
> stdout { codec =\> "rubydebug" }  
> }

But I get _Returns.row.xxx_ as output field name. So I try the _add field_ option wihtout success  
Any clue ?

Here is the output i get

> {  
> "Returns" =\> {  
> "Row" =\> {  
> "name" =\> "LOCAL.ESB.MONITORING\_ROUTER.AuditNotification",  
> "pendingMessageCount" =\> "106"  
> }  
> },  
> "@version" =\> "1",  
> "@timestamp" =\> "2015-10-23T16:25:54.534Z",  
> "name" =\> "%{Returns.Row.name}"  
> }  
> {  
> "Returns" =\> {  
> "Row" =\> {  
> "name" =\> "LOCAL.ESB.CORE\_AUDIT.LogEvent",  
> "pendingMessageCount" =\> "138"  
> }  
> },  
> "@version" =\> "1",  
> "@timestamp" =\> "2015-10-23T16:25:54.534Z",  
> "name" =\> "%{Returns.Row.name}"  
> }

Thanks for your help

---

<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: [October 23, 2015, 7:31pm UTC](https://discuss.elastic.co/t/json-array-parsing-field-name/32870/2 "2015-10-23T19:31:23Z")

</div>

> ```
> field => "Returns[Row]"
> 
> ```

What's this syntax supposed to mean? Do you mean `[Returns][Row]`?

> But I get Returns.row.xxx as output field name.

The field reference `Returns.Row.xxx` literally means "the field named Returns.Row.xxx", i.e. the following JSON snippet:

```
"Returns.row.xxx": { ... }

```

If the structure actually looks like

```
"Returns": {
  "Row": {
    "xxx": { ... }
  }
}

```

you need `[Returns][Row][xxx]`.

---

<div class="post-metadata">

### Author: ![apoc](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@apoc](https://discuss.elastic.co/u/apoc)
#### Post date: [November 16, 2015, 4:24pm UTC](https://discuss.elastic.co/t/json-array-parsing-field-name/32870/3 "2015-11-16T16:24:34Z")

</div>

Hi Magnus,

Sorry for the late reply. It works fine with [Returns][Row] 😄  
Thank you for your help

Jeremy

---

<div class="post-metadata">

### Author: ![Kiranmai\_Reddy](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Kiranmai\_Reddy](https://discuss.elastic.co/u/Kiranmai_Reddy)
#### Post date: [May 29, 2017, 1:41pm UTC](https://discuss.elastic.co/t/json-array-parsing-field-name/32870/4 "2017-05-29T13:41:34Z")

</div>

how do I parse array of jsons something similar to  
[  
{"id" : "kvkevbe"  
},  
{"id" : "nfavnkv"  
},  
{"id" : "knknks"  
},  
{"id" : "fkoiuhu"  
}  
]  
can some one 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: [July 6, 2017, 4:26am UTC](https://discuss.elastic.co/t/json-array-parsing-field-name/32870/5 "2017-07-06T04:26:16Z")

</div>


