# MongoDB failed to send event

**URL:** <https://discuss.elastic.co/t/mongodb-failed-to-send-event/179266>\
**Category:** Logstash\
**Created:** [May 1, 2019, 11:09pm UTC](https://discuss.elastic.co/t/mongodb-failed-to-send-event/179266 "2019-05-01T23:09:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gx0s](https://avatars.discourse-cdn.com/v4/letter/g/a5b964/32.png) [@gx0s](https://discuss.elastic.co/u/gx0s)\
**Post date:** [May 1, 2019, 11:09pm UTC](https://discuss.elastic.co/t/mongodb-failed-to-send-event/179266/1 "2019-05-01T23:09:49Z")

</div>

Hi,

I am getting this error on logstash

[WARN] 2019-05-01 23:01:42.484 [[main]\>worker1] mongodb - Failed to send event to MongoDB, retrying in 3 seconds {:event=\>#LogStash::Event:0x527d46ff, :exception=\>java.lang.NullPointerException

output {

mongodb {  
codec =\> "json"  
uri =\> "mongodb://localhost:27017/foo"  
database =\> "foo"  
collection =\> "nop"  
generateId =\> true  
}

}

---

<div class="post-metadata">

**Author:** ![gx0s](https://avatars.discourse-cdn.com/v4/letter/g/a5b964/32.png) [@gx0s](https://discuss.elastic.co/u/gx0s)\
**Post date:** [May 2, 2019, 7:41am UTC](https://discuss.elastic.co/t/mongodb-failed-to-send-event/179266/2 "2019-05-02T07:41:26Z")

</div>

The problem was on the mutate statemenet,  
it didn't work when I tried to remove @timestamp, @version on mutate statement

don't work for  
remove\_field: ["@timestamp"]

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [May 2, 2019, 2:04pm UTC](https://discuss.elastic.co/t/mongodb-failed-to-send-event/179266/3 "2019-05-02T14:04:47Z")

</div>

> [@gx0s](#):
>
> don't work for  
> remove\_field: ["@timestamp"]

That does not surprise me. Some outputs require @timestamp to exist.

---

<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:** [May 30, 2019, 2:04pm UTC](https://discuss.elastic.co/t/mongodb-failed-to-send-event/179266/4 "2019-05-30T14:04:49Z")

</div>

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