# Index replace events instead of adding each one

**URL:** <https://discuss.elastic.co/t/index-replace-events-instead-of-adding-each-one/157645>\
**Category:** Elasticsearch\
**Created:** [November 21, 2018, 7:57am UTC](https://discuss.elastic.co/t/index-replace-events-instead-of-adding-each-one/157645 "2018-11-21T07:57:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![m0n0lith](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@m0n0lith](https://discuss.elastic.co/u/m0n0lith)\
**Post date:** [November 21, 2018, 7:57am UTC](https://discuss.elastic.co/t/index-replace-events-instead-of-adding-each-one/157645/1 "2018-11-21T07:57:21Z")

</div>

I have noticed that my test cluster are doing something really wierd.  
Instead of adding each event it seems to replace the one document/event in the index with a new one.  
Like this; one event comes from logstash(syslog) and index counts that it has one event/doc. Next event replaces the old event and event/doc count are still one. And this continues all day.  
This image is from monitoring view in Kibana, index rate is 307.86/s and doc count stays 1.

 ![38](https://us1.discourse-cdn.com/elastic/original/3X/6/0/60655ae815c3870857f52d78078b34211d1ad9f7.png)  
Anyone seen this behaivor? I would like to fix this without rebuild. Just so I know what to do if it ever happens again.  
Funny part is that the .monitoring index works. But not the one I create myself or from Logstash output.

Setup info:  
Version - 6.3.2  
3 node cluster with seperated kibana node.  
Seperated logstash cluster that parse with grok and kv filters.

Logstash output config, part:  
if "firewalls" in [fields][sourcetype] {  
elasticsearch {  
hosts =\> ["[node01.example.com:9200](http://node01.example.com:9200)","[node02.example.com:9200](http://node02.example.com:9200)","[node03.example.com:9200](http://node03.example.com:9200)"]  
sniffing =\> false  
manage\_template =\> false  
index =\> "logs-firewalls-%{+YYYY.MM.dd}"  
document\_id =\> "fw"  
}

---

<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:** [November 21, 2018, 8:12am UTC](https://discuss.elastic.co/t/index-replace-events-instead-of-adding-each-one/157645/2 "2018-11-21T08:12:12Z")

</div>

> [@m0n0lith](#):
>
> document\_id =\> "fw"

That's why. See [Elasticsearch output plugin | Logstash Reference [8.11] | Elastic](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-document_id)

---

<div class="post-metadata">

**Author:** ![m0n0lith](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@m0n0lith](https://discuss.elastic.co/u/m0n0lith)\
**Post date:** [November 21, 2018, 8:16am UTC](https://discuss.elastic.co/t/index-replace-events-instead-of-adding-each-one/157645/3 "2018-11-21T08:16:13Z")

</div>

Alright will try it out.  
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 19, 2018, 8:16am UTC](https://discuss.elastic.co/t/index-replace-events-instead-of-adding-each-one/157645/4 "2018-12-19T08:16:15Z")

</div>

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