# \_id needs to be unique only in index?

**URL:** <https://discuss.elastic.co/t/id-needs-to-be-unique-only-in-index/209039>\
**Category:** Elasticsearch\
**Created:** [November 22, 2019, 10:06am UTC](https://discuss.elastic.co/t/id-needs-to-be-unique-only-in-index/209039 "2019-11-22T10:06:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [November 22, 2019, 10:06am UTC](https://discuss.elastic.co/t/id-needs-to-be-unique-only-in-index/209039/1 "2019-11-22T10:06:32Z")

</div>

Hi,

If I set the \_id field on my own in logstash, where does it needs to be unique? Only within the same index or in all indices?

Thanks, Andreas

---

<div class="post-metadata">

**Author:** ![somnath.guthula](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@somnath.guthula](https://discuss.elastic.co/u/somnath.guthula)\
**Post date:** [November 22, 2019, 10:40am UTC](https://discuss.elastic.co/t/id-needs-to-be-unique-only-in-index/209039/2 "2019-11-22T10:40:56Z")

</div>

It needs to be unique within the same index.

---

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [November 22, 2019, 11:29am UTC](https://discuss.elastic.co/t/id-needs-to-be-unique-only-in-index/209039/3 "2019-11-22T11:29:41Z")

</div>

thanks

---

<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:** [December 20, 2019, 11:44am UTC](https://discuss.elastic.co/t/id-needs-to-be-unique-only-in-index/209039/4 "2019-12-20T11:44:22Z")

</div>

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