# How to create new field by comparing the data against JSON using Pipelines or Logstash

**URL:** <https://discuss.elastic.co/t/how-to-create-new-field-by-comparing-the-data-against-json-using-pipelines-or-logstash/277102>\
**Category:** Kibana\
**Created:** [June 25, 2021, 8:03pm UTC](https://discuss.elastic.co/t/how-to-create-new-field-by-comparing-the-data-against-json-using-pipelines-or-logstash/277102 "2021-06-25T20:03:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mahesh\_Gadagi](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@Mahesh\_Gadagi](https://discuss.elastic.co/u/Mahesh_Gadagi)\
**Post date:** [June 25, 2021, 8:03pm UTC](https://discuss.elastic.co/t/how-to-create-new-field-by-comparing-the-data-against-json-using-pipelines-or-logstash/277102/1 "2021-06-25T20:03:54Z")

</div>

Hello,

I wanted to create a new field either using logstash or elastic search pipeline, can you please help me?

I have JSON mapping as `[{"name":"a","age":25},{"name":"b","age":10}]` I have field already in my index as name and now I want to create new field age by comparing the name.

Which approach I should follow to achieve this?

Regards,  
Mahesh

---

<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 23, 2021, 8:04pm UTC](https://discuss.elastic.co/t/how-to-create-new-field-by-comparing-the-data-against-json-using-pipelines-or-logstash/277102/2 "2021-07-23T20:04:07Z")

</div>

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