# Logstash doesn't delete nested fileds from json field

**URL:** <https://discuss.elastic.co/t/logstash-doesnt-delete-nested-fileds-from-json-field/275022>\
**Category:** Logstash\
**Created:** [June 5, 2021, 10:25am UTC](https://discuss.elastic.co/t/logstash-doesnt-delete-nested-fileds-from-json-field/275022 "2021-06-05T10:25:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![74db36a597f21b891b3f](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/74db36a597f21b891b3f/32/45367_2.png) [@74db36a597f21b891b3f](https://discuss.elastic.co/u/74db36a597f21b891b3f)\
**Post date:** [June 5, 2021, 10:25am UTC](https://discuss.elastic.co/t/logstash-doesnt-delete-nested-fileds-from-json-field/275022/1 "2021-06-05T10:25:03Z")

</div>

Hello there. I have an issue.  
In my logs there is raw string that contains json.  
I apply the json Logstash filter to it to get json-structured field.

```auto
    json {
      source => "response_body"
      target => "response_fields"
      remove_field => ["response_body"]
    }

```

The output field contains multiple similar nested fields that i don't need.  
I want to delete them but Logstash doesn't do it and I can't get why.  
I tried to do it inside json plugin like

```auto
json {
      source => "response_body"
      target => "response_fields"
      remove_field => ["response_body","[response_fields][contents][agg_content_gid]" ]
    }

```

Or by mutate plugin after json, but with no result. Fields still remains in index?  
What am I doing wrong?

---

<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 3, 2021, 10:25am UTC](https://discuss.elastic.co/t/logstash-doesnt-delete-nested-fileds-from-json-field/275022/2 "2021-07-03T10:25:26Z")

</div>

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