# Removing parent object names with ingest pipeline

**URL:** <https://discuss.elastic.co/t/removing-parent-object-names-with-ingest-pipeline/251492>\
**Category:** Elasticsearch\
**Created:** [October 8, 2020, 5:27pm UTC](https://discuss.elastic.co/t/removing-parent-object-names-with-ingest-pipeline/251492 "2020-10-08T17:27:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![seanziee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seanziee/32/45151_2.png) [@seanziee](https://discuss.elastic.co/u/seanziee)\
**Post date:** [October 8, 2020, 5:27pm UTC](https://discuss.elastic.co/t/removing-parent-object-names-with-ingest-pipeline/251492/1 "2020-10-08T17:27:38Z")

</div>

I'm trying to figure out how to clean up my fields and remove some of the top level parents in my documents. I want to turn `Properties.Status` and `Properties.Status.StatusName` into `Status` and `Status.StatusName`, respectively.

With logstash this is done with a ruby filter that looks like:

```auto
            ruby {
                code => '
                    if (event.get("Properties"))
                        event.get("Properties").each { |j,p|
                            event.set(j,p);
                            }
                        event.remove("Properties");
                    end
                '
            }

```

But I need to do this with an ingest pipeline and I'm not as familiar with painless. Any 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:** [November 5, 2020, 5:27pm UTC](https://discuss.elastic.co/t/removing-parent-object-names-with-ingest-pipeline/251492/2 "2020-11-05T17:27:38Z")

</div>

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