# Document ID

**URL:** <https://discuss.elastic.co/t/document-id/45773>\
**Category:** Elasticsearch\
**Created:** [March 30, 2016, 9:38am UTC](https://discuss.elastic.co/t/document-id/45773 "2016-03-30T09:38:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sameer\_Dharur](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@Sameer\_Dharur](https://discuss.elastic.co/u/Sameer_Dharur)\
**Post date:** [March 30, 2016, 9:38am UTC](https://discuss.elastic.co/t/document-id/45773/1 "2016-03-30T09:38:23Z")

</div>

Where exactly do I get the ID of an Elasticsearch document? I need it for the R module I'm using with Elasticsearch to import data. When I do a GET query, I only see the IDs of each log within the document. See attached screenshot.

This has been indexed with Logstash.

 ![](https://us1.discourse-cdn.com/elastic/original/2X/f/f49e8c578028339c3f882e5534f37b802a74e41c.png)

---

<div class="post-metadata">

**Author:** ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)\
**Post date:** [March 30, 2016, 9:51am UTC](https://discuss.elastic.co/t/document-id/45773/2 "2016-03-30T09:51:09Z")

</div>

Hi,

I'm not exactly sure I understand the question. The id of an elasticsearch document is what you get with the `_id` field, which is visible in your example. For the logging use case, most of the time each line in a log file gets indexed as a single document in elasticsearch, so you won't have another ID for the source document unless you store it in some field alongside your log lines.  
Please let me know if I missunderstood something.

---

<div class="post-metadata">

**Author:** ![Sameer\_Dharur](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@Sameer\_Dharur](https://discuss.elastic.co/u/Sameer_Dharur)\
**Post date:** [March 30, 2016, 10:17am UTC](https://discuss.elastic.co/t/document-id/45773/3 "2016-03-30T10:17:29Z")

</div>

The whole index is called 'logstash-templightlogs' and is of the type 'sample'. The thing is, I need to provide the ID of this index if I want to import all the logs into my RStudio. Therefore, the whole thing 'logstash-templightlogs' needs an ID. As of now it has an autogenerated UUID which is not good enough for R.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [April 1, 2016, 6:02am UTC](https://discuss.elastic.co/t/document-id/45773/4 "2016-04-01T06:02:47Z")

</div>

I don't understand. Elasticsearch indexes don't have IDs, they have unique names and can't be renamed. Documents in an index have IDs, but default autogenerated but you can set them to an explicit value if you prefer.

---

<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:** [July 5, 2017, 11:03pm UTC](https://discuss.elastic.co/t/document-id/45773/5 "2017-07-05T23:03:26Z")

</div>


