# Mapping one field from csv file to two fields in elasticsearch template file

**URL:** <https://discuss.elastic.co/t/mapping-one-field-from-csv-file-to-two-fields-in-elasticsearch-template-file/111462>\
**Category:** Logstash\
**Created:** [December 13, 2017, 12:06am UTC](https://discuss.elastic.co/t/mapping-one-field-from-csv-file-to-two-fields-in-elasticsearch-template-file/111462 "2017-12-13T00:06:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arjun\_subramanyam\_va](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@Arjun\_subramanyam\_va](https://discuss.elastic.co/u/Arjun_subramanyam_va)\
**Post date:** [December 13, 2017, 12:06am UTC](https://discuss.elastic.co/t/mapping-one-field-from-csv-file-to-two-fields-in-elasticsearch-template-file/111462/1 "2017-12-13T00:06:49Z")

</div>

I have a title column in my csv file in the elastic search schema we defined two entities namely student and teacher both share this title field like student.title and teacher.title how can i specify this in logstash

---

<div class="post-metadata">

**Author:** ![Arjun\_subramanyam\_va](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@Arjun\_subramanyam\_va](https://discuss.elastic.co/u/Arjun_subramanyam_va)\
**Post date:** [December 13, 2017, 1:26am UTC](https://discuss.elastic.co/t/mapping-one-field-from-csv-file-to-two-fields-in-elasticsearch-template-file/111462/2 "2017-12-13T01:26:15Z")

</div>

I figured how to do this,

mutate {  
add\_field =\> {

```
                    "[student][title]" => "%{title}"

                    "[teacher][title]" => "%{title}"

            } 

```

}

---

<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:** [January 10, 2018, 1:26am UTC](https://discuss.elastic.co/t/mapping-one-field-from-csv-file-to-two-fields-in-elasticsearch-template-file/111462/3 "2018-01-10T01:26:51Z")

</div>

Closed on January 10, 2018, 1:26am UTC

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