# When field \_index in elasticsearch is generated?

**URL:** <https://discuss.elastic.co/t/when-field-index-in-elasticsearch-is-generated/309519>\
**Category:** Logstash\
**Created:** [July 13, 2022, 9:50am UTC](https://discuss.elastic.co/t/when-field-index-in-elasticsearch-is-generated/309519 "2022-07-13T09:50:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![maoxuguang](https://avatars.discourse-cdn.com/v4/letter/m/97f17d/32.png) [@maoxuguang](https://discuss.elastic.co/u/maoxuguang)\
**Post date:** [July 13, 2022, 9:50am UTC](https://discuss.elastic.co/t/when-field-index-in-elasticsearch-is-generated/309519/1 "2022-07-13T09:50:51Z")

</div>

in elasticsearch, there is a field named \_index, is this field generated by logstash?  
In logstash we output same data to both elasticsearch and mongodb, while elasticsearch has a field named \_index, but mongodb has no such field, how can we get the value of this field and output to mongodb?

---

<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:** [July 13, 2022, 4:19pm UTC](https://discuss.elastic.co/t/when-field-index-in-elasticsearch-is-generated/309519/2 "2022-07-13T16:19:12Z")

</div>

The meta field `_index` is created in Elastic but the value is the name of the index. So if you know the name of the index you are sending to Elastic you should be able to use that for MongoDB.

---

<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:** [August 10, 2022, 4:20pm UTC](https://discuss.elastic.co/t/when-field-index-in-elasticsearch-is-generated/309519/3 "2022-08-10T16:20:00Z")

</div>

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