# Exceptions for Rename Ingest Processor

**URL:** <https://discuss.elastic.co/t/exceptions-for-rename-ingest-processor/281399>\
**Category:** Elasticsearch\
**Tags:** ingest-pipeline\
**Created:** [August 13, 2021, 7:16pm UTC](https://discuss.elastic.co/t/exceptions-for-rename-ingest-processor/281399 "2021-08-13T19:16:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pkward](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pkward/32/95305_2.png) [@pkward](https://discuss.elastic.co/u/pkward)\
**Post date:** [August 13, 2021, 7:16pm UTC](https://discuss.elastic.co/t/exceptions-for-rename-ingest-processor/281399/1 "2021-08-13T19:16:49Z")

</div>

Hi,

I'm trying to create an ingest pipeline to rename fields, if they exist. I see there is an if statement option for the Rename processor, but I'm unsure of how to implement it. I want to do "if" : "ctx.containsKey('field')", then rename it to the specified field.

---

<div class="post-metadata">

**Author:** ![pkward](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pkward/32/95305_2.png) [@pkward](https://discuss.elastic.co/u/pkward)\
**Post date:** [August 16, 2021, 12:21pm UTC](https://discuss.elastic.co/t/exceptions-for-rename-ingest-processor/281399/2 "2021-08-16T12:21:25Z")

</div>

I've found my solution.

---

<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:** [September 13, 2021, 12:21pm UTC](https://discuss.elastic.co/t/exceptions-for-rename-ingest-processor/281399/3 "2021-09-13T12:21:28Z")

</div>

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