# Add data according to JSON file

**URL:** <https://discuss.elastic.co/t/add-data-according-to-json-file/311630>\
**Category:** Logstash\
**Created:** [August 8, 2022, 7:39am UTC](https://discuss.elastic.co/t/add-data-according-to-json-file/311630 "2022-08-08T07:39:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mehmetalix](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mehmetalix/32/100571_2.png) [@mehmetalix](https://discuss.elastic.co/u/mehmetalix)\
**Post date:** [August 8, 2022, 7:39am UTC](https://discuss.elastic.co/t/add-data-according-to-json-file/311630/1 "2022-08-08T07:39:49Z")

</div>

Hi,  
I'm ingesting data from database and trying to create new field and ingest data according to a JSON file. Let me give an example:  
I have field named 'type' and data in this field as 'cat', 'dog', 'flower'.  
Also have an JSON file like this:

```auto
{
    "cat": "animal",
    "dog": "animal",
    "flower": "plant"
}

```

I want to create a field named ''type\_super" and add data by this JSON.  
e.g.,

\*doc - type - type\_super  
doc1 - cat - animal  
doc2 - flower - plant  
doc3 - dog - animal

---

<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 5, 2022, 7:40am UTC](https://discuss.elastic.co/t/add-data-according-to-json-file/311630/2 "2022-09-05T07:40:36Z")

</div>

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