# Getting Nested Fields Elasticsearch Filter

**URL:** <https://discuss.elastic.co/t/getting-nested-fields-elasticsearch-filter/118223>\
**Category:** Logstash\
**Created:** [February 2, 2018, 12:18pm UTC](https://discuss.elastic.co/t/getting-nested-fields-elasticsearch-filter/118223 "2018-02-02T12:18:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kahndor](https://avatars.discourse-cdn.com/v4/letter/k/97f17d/32.png) [@kahndor](https://discuss.elastic.co/u/kahndor)\
**Post date:** [February 2, 2018, 12:18pm UTC](https://discuss.elastic.co/t/getting-nested-fields-elasticsearch-filter/118223/1 "2018-02-02T12:18:53Z")

</div>

I using the logstash-elasticsearch-filter to correlate events from Elasticsearch. Some of the fields that I need to return from the Elasticsearch hit are nested. I have been unable to retrieve these docs and the result is always null.

I am using Logstash 5.6.5 and ES 5.6.5.

Here is my configuration:

> ```
> "fields" => {            
> "field.otherField.anotherField" => "p_time_gmt"
> }
> 
> ```

I have also tried:

> ```
> [field][otherField][anotherField]
> [field][otherField][0][anotherField]
> 
> ```

Without luck.

The json response from ES looks like:

```
field": {
        "otherField": [
              {
                "anthorField": "someText"
              }
       ]
}

```

---

<div class="post-metadata">

**Author:** ![kahndor](https://avatars.discourse-cdn.com/v4/letter/k/97f17d/32.png) [@kahndor](https://discuss.elastic.co/u/kahndor)\
**Post date:** [February 4, 2018, 3:48pm UTC](https://discuss.elastic.co/t/getting-nested-fields-elasticsearch-filter/118223/2 "2018-02-04T15:48:20Z")

</div>

I was able to solve the problem using a workaround. I extracted the top level key and then parsed it with a mutate filter. I think this is a bug and would be a useful feature.

---

<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 4, 2018, 3:48pm UTC](https://discuss.elastic.co/t/getting-nested-fields-elasticsearch-filter/118223/3 "2018-03-04T15:48:21Z")

</div>

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