# Install index mapping stored in a file - elasticsearch 7.x

**URL:** <https://discuss.elastic.co/t/install-index-mapping-stored-in-a-file-elasticsearch-7-x/220355>\
**Category:** Elasticsearch\
**Created:** [February 21, 2020, 12:34pm UTC](https://discuss.elastic.co/t/install-index-mapping-stored-in-a-file-elasticsearch-7-x/220355 "2020-02-21T12:34:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![smm](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@smm](https://discuss.elastic.co/u/smm)\
**Post date:** [February 21, 2020, 12:34pm UTC](https://discuss.elastic.co/t/install-index-mapping-stored-in-a-file-elasticsearch-7-x/220355/1 "2020-02-21T12:34:03Z")

</div>

Hi there,

I have a json file with an index mapping definition in it. What is the best way to import it into elasticsearch? I would like to do it via curl / CLI.  
Cheers!

---

<div class="post-metadata">

**Author:** ![Bernt\_Rostad](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@Bernt\_Rostad](https://discuss.elastic.co/u/Bernt_Rostad)\
**Post date:** [February 21, 2020, 12:48pm UTC](https://discuss.elastic.co/t/install-index-mapping-stored-in-a-file-elasticsearch-7-x/220355/2 "2020-02-21T12:48:59Z")

</div>

> [@smm](#):
>
> I have a json file with an index mapping definition in it. What is the best way to import it

Just point curl to the file and give the template a name:

`curl -XPUT 'http://localhost:9200/_template/my_index_templ' -H 'Content-Type: application/json' -d @your_file.json`

Good luck!

---

<div class="post-metadata">

**Author:** ![smm](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@smm](https://discuss.elastic.co/u/smm)\
**Post date:** [February 24, 2020, 7:38am UTC](https://discuss.elastic.co/t/install-index-mapping-stored-in-a-file-elasticsearch-7-x/220355/3 "2020-02-24T07:38:56Z")

</div>

Thank you!

---

<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:** [March 23, 2020, 7:38am UTC](https://discuss.elastic.co/t/install-index-mapping-stored-in-a-file-elasticsearch-7-x/220355/4 "2020-03-23T07:38:57Z")

</div>

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