# Access arrays in array

**URL:** <https://discuss.elastic.co/t/access-arrays-in-array/74828>\
**Category:** Logstash\
**Created:** [February 13, 2017, 2:04am UTC](https://discuss.elastic.co/t/access-arrays-in-array/74828 "2017-02-13T02:04:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yxc](https://avatars.discourse-cdn.com/v4/letter/y/858c86/32.png) [@yxc](https://discuss.elastic.co/u/yxc)\
**Post date:** [February 13, 2017, 2:04am UTC](https://discuss.elastic.co/t/access-arrays-in-array/74828/1 "2017-02-13T02:04:52Z")

</div>

Hi all,

I have a nested field with arrays in array in JSON like the following:

```
{
	"foo": {
		"bar": [
			[
				"a",
				"b"
			],
			[
				"c",
				"d"
			]
		]
	}
}

```

The following is my config file:

```
input {
	file {
		codec => "json"
		path => "pathtofile"
		type => "footype"
		start_position => "beginning"
	}
}
filter {
	json {
		source => "message"
		remove_field => ["host", "message", "path"]
	}
}
output {
	elasticsearch {
		action => "index"
		index => "bar"
		hosts => ["http://localhost:9200"]
	}
}

```

I got the following error:

`09:40:47.725 [[main]>worker0] WARN logstash.outputs.elasticsearch - Failed action. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"bar", :_type=>"footype", :_routing=>nil}, 2017-02-13T01:40:30.387Z myconnection %{message}], :response=>{"index"=>{"_index"=>"bar", "_type"=>"footype", "_id"=>"AVo1IN0vK2jgwdCXqZ-q", "status"=>400, "error"=>{"type"=>"illegal_argument_exception", "reason"=>"mapper [foo.bar] of different type, current_type [long], merged_type [text]"}}}}`

I have a feeling that it's the array problem. I have done some research and know that array is not well supported. But I need to ingest the array in elasticsearch. Is there a way to actually do that?

Any helps will be appreciated.

---

<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 13, 2017, 2:04am UTC](https://discuss.elastic.co/t/access-arrays-in-array/74828/2 "2017-03-13T02:04:56Z")

</div>

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