# Records disappearing while using custom document\_id

**URL:** <https://discuss.elastic.co/t/records-disappearing-while-using-custom-document-id/100174>\
**Category:** Elasticsearch\
**Created:** [September 12, 2017, 8:39am UTC](https://discuss.elastic.co/t/records-disappearing-while-using-custom-document-id/100174 "2017-09-12T08:39:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![karnamonkster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karnamonkster/32/67266_2.png) [@karnamonkster](https://discuss.elastic.co/u/karnamonkster)\
**Post date:** [September 12, 2017, 8:39am UTC](https://discuss.elastic.co/t/records-disappearing-while-using-custom-document-id/100174/1 "2017-09-12T08:39:43Z")

</div>

Hello,  
We are trying to use a "Document\_id" within ES output configuration (using multiple field columns from the Oracle Database table for example:

`document_id => %{field1}%{field2}`

Reason being to be able to have only one unique record in ES with the value field (field3) updated every minute with the latest near real-time value. (without creating duplicate records for each unique value)

However we noted that during a consequent run scheduled every minute using JDBC input, the record vanishes from the index if that document\_id does not exists.

kindly help in this matter.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 12, 2017, 8:41am UTC](https://discuss.elastic.co/t/records-disappearing-while-using-custom-document-id/100174/2 "2017-09-12T08:41:41Z")

</div>

What index output pattern are you using?

---

<div class="post-metadata">

**Author:** ![karnamonkster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karnamonkster/32/67266_2.png) [@karnamonkster](https://discuss.elastic.co/u/karnamonkster)\
**Post date:** [September 12, 2017, 8:51am UTC](https://discuss.elastic.co/t/records-disappearing-while-using-custom-document-id/100174/3 "2017-09-12T08:51:06Z")

</div>

There are no filters to my logstash configuration  
Here is what it looks like

```
output { 
elasticsearch
{ 
hosts => ["array of hosts"]
document_id => "%{field1}%{field2}"
document_type => "flags"
index => "valflags-%{+YYYY.MM.dd}"
template => "/usr/share/...elasticsearch-template-es5x.json"
template_overwrite => true
}
}
```

---

<div class="post-metadata">

**Author:** ![karnamonkster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karnamonkster/32/67266_2.png) [@karnamonkster](https://discuss.elastic.co/u/karnamonkster)\
**Post date:** [September 13, 2017, 5:12pm UTC](https://discuss.elastic.co/t/records-disappearing-while-using-custom-document-id/100174/4 "2017-09-13T17:12:40Z")

</div>

Anything you seem is strange?

---

<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:** [October 11, 2017, 5:12pm UTC](https://discuss.elastic.co/t/records-disappearing-while-using-custom-document-id/100174/5 "2017-10-11T17:12:49Z")

</div>

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