# Logstash cannot correctly send data of mongo collection to elasticsaearch

**URL:** <https://discuss.elastic.co/t/logstash-cannot-correctly-send-data-of-mongo-collection-to-elasticsaearch/152642>\
**Category:** Logstash\
**Created:** [October 16, 2018, 11:31am UTC](https://discuss.elastic.co/t/logstash-cannot-correctly-send-data-of-mongo-collection-to-elasticsaearch/152642 "2018-10-16T11:31:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![NIloufarVafaei](https://avatars.discourse-cdn.com/v4/letter/n/5fc32e/32.png) [@NIloufarVafaei](https://discuss.elastic.co/u/NIloufarVafaei)\
**Post date:** [October 16, 2018, 11:31am UTC](https://discuss.elastic.co/t/logstash-cannot-correctly-send-data-of-mongo-collection-to-elasticsaearch/152642/1 "2018-10-16T11:31:42Z")

</div>

hi  
here is my logstash config  
input {  
mongodb {  
uri =\> 'mongodb://boomrang:\*\*\*\*\*\*\*/boomrang'  
placeholder\_db\_dir =\> '/tmp'  
placeholder\_db\_name =\> 'boomrang\_tarrifs.db'  
collection =\> 'tariffs'  
batch\_size =\> 5000  
}  
}  
filter {  
mutate {  
remove\_field =\>["\_id", "\_\_v", "wageFormulas"]  
}  
}  
filter {  
date {  
match =\> ["logdate", "ISO8601"]  
}  
}

output {  
elasticsearch {  
action =\>"update"  
doc\_as\_upsert =\> true  
hosts =\> ["localhost:9200"]  
index =\> "tariffs"  
document\_id =\> "%{mongo\_id}%{date}"  
}  
stdout { codec =\> rubydebug}  
}

and it is one of my record in collection "tarrifes" that i want sent it to elasticsearch  
{  
"\_id" : ObjectId("5b98d8114ef6cb5bcebb9894"),  
"name" : "Usual 9706",  
"farsiName" : "کارمزد استاندارد 9706",  
"type" : "PUBLIC",  
"createdDate" : "13970621133938",  
"lastUpdate" : "13970621133938",  
"supportWage" : 1000000,  
"wageFormulas" : [],  
"\_\_v" : 0  
}

problem is the tarrifs collection has 23 record and logstash read more data so in kibana i see 100 recort for tarrif collection and the num of this hits become more when i refresh kibana.  
how can i solve this problem?

---

<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:** [November 13, 2018, 11:31am UTC](https://discuss.elastic.co/t/logstash-cannot-correctly-send-data-of-mongo-collection-to-elasticsaearch/152642/2 "2018-11-13T11:31:42Z")

</div>

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