# Add new field in Kibana based off condition

**URL:** https://discuss.elastic.co/t/add-new-field-in-kibana-based-off-condition/287064
**Category:** Kibana
**Created:** [October 19, 2021, 9:02am UTC](https://discuss.elastic.co/t/add-new-field-in-kibana-based-off-condition/287064 "2021-10-19T09:02:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Sugand](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@Sugand](https://discuss.elastic.co/u/Sugand)
#### Post date: [October 19, 2021, 9:02am UTC](https://discuss.elastic.co/t/add-new-field-in-kibana-based-off-condition/287064/1 "2021-10-19T09:02:15Z")

</div>

Hi all,

Need to have a quick compare of 2 index's ,

Example: index1 have columns a,b,c index 2 also have same columns a,b,c, now I want to create a new column "d" if the condition index1.a == index2.a, if equal the value in "d" will be 1 else 0 hence I could split and bucket the values based off "d" in visualization.

Appreciate your inputs on the same.

---

<div class="post-metadata">

### Author: ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)
#### Post date: [October 19, 2021, 1:55pm UTC](https://discuss.elastic.co/t/add-new-field-in-kibana-based-off-condition/287064/2 "2021-10-19T13:55:29Z")

</div>

You should be able to do this with the [Enrich Processor](https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-processor.html).

You would `match` on field `a` and for all records that matched set `target_field` to 1.

---

<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 16, 2021, 1:55pm UTC](https://discuss.elastic.co/t/add-new-field-in-kibana-based-off-condition/287064/3 "2021-11-16T13:55:47Z")

</div>

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