# Remove a pattern from json nested fields

**URL:** https://discuss.elastic.co/t/remove-a-pattern-from-json-nested-fields/254542
**Category:** Logstash
**Created:** [November 6, 2020, 3:08pm UTC](https://discuss.elastic.co/t/remove-a-pattern-from-json-nested-fields/254542 "2020-11-06T15:08:23Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![nilubkal](https://avatars.discourse-cdn.com/v4/letter/n/d9b06d/32.png) [@nilubkal](https://discuss.elastic.co/u/nilubkal)
#### Post date: [November 6, 2020, 3:08pm UTC](https://discuss.elastic.co/t/remove-a-pattern-from-json-nested-fields/254542/1 "2020-11-06T15:08:23Z")

</div>

Hey guys,  
i have the following json structure which i would like to rename from :

```auto
     json.detail.info.processed_event.instance_id	
     json.detail.info.processed_event.invalidations.metadata	
     json.detail.info.processed_event.invalidations.remote_schemas	 
     json.detail.info.processed_event.occurred_at  

```

to

```auto
    json.processed_event.instance_id	
    json.processed_event.invalidations.metadata	
    json.processed_event.invalidations.remote_schemas	 
    json.processed_event.occurred_at  

```

by removing _[detailed][info]_ . Is it achievable without using a ruby script ?  
Thanks !

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [November 6, 2020, 3:42pm UTC](https://discuss.elastic.co/t/remove-a-pattern-from-json-nested-fields/254542/2 "2020-11-06T15:42:57Z")

</div>

If you have a fixed list of fields you could do it using mutate+rename. If you want to iterate over every field without knowing what they are called in advance then you will have to use ruby.

---

<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: [December 4, 2020, 3:43pm UTC](https://discuss.elastic.co/t/remove-a-pattern-from-json-nested-fields/254542/3 "2020-12-04T15:43:02Z")

</div>

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