Logstash-output-mongodb - bad file descriptor

I have my logstash config as below:

output {
    if [type] == "netflow" {
        elasticsearch {
            hosts => [ "${ELASTIFLOW_ES_HOST:127.0.0.1:9200}" ]
            user => "${ELASTIFLOW_ES_USER:elastic}"
            password => "${ELASTIFLOW_ES_PASSWD:changeme}"
            index => "netflow-%{+YYYY.MM.dd}"
            template => "${ELASTIFLOW_TEMPLATE_PATH:/etc/logstash/templates}/netflow.template.json"
            template_name => "netflow"
            template_overwrite => "true"
        }
        mongodb {
            uri => "mongodb://localhost:3001"
            database => "meteor"
            collection => "logstash_%{type}"
            isodate => true
        }
    }

}

Since I'm using a meteor's built in mongodb, the db goes offline if the meteor app gets killed. Once the meteor app is back online, logstash continues to complain with the below message, until I restart logstash.

[2017-11-21T15:34:12,447][DEBUG][logstash.pipeline        ] Pushing flush onto pipeline
[2017-11-21T15:34:14,195][DEBUG][logstash.outputs.mongodb ] MONGODB | COMMAND | namespace=admin.$cmd selector={:ismaster=>1} flags=[] limit=-1 skip=0 project=nil | runtime: 0.9999ms
[2017-11-21T15:34:14,195][DEBUG][logstash.outputs.mongodb ] MONGODB | Bad file descriptor - Bad file descriptor | runtime: 0.0000ms
[2017-11-21T15:34:14,695][DEBUG][logstash.outputs.mongodb ] MONGODB | COMMAND | namespace=admin.$cmd selector={:ismaster=>1} flags=[] limit=-1 skip=0 project=nil | runtime: 1.9999ms
[2017-11-21T15:34:14,695][DEBUG][logstash.outputs.mongodb ] MONGODB | Bad file descriptor - Bad file descriptor | runtime: 0.0000ms
[2017-11-21T15:34:15,195][DEBUG][logstash.outputs.mongodb ] MONGODB | COMMAND | namespace=admin.$cmd selector={:ismaster=>1} flags=[] limit=-1 skip=0 project=nil | runtime: 1.9999ms
[2017-11-21T15:34:15,195][DEBUG][logstash.outputs.mongodb ] MONGODB | Bad file descriptor - Bad file descriptor | runtime: 0.0000ms

How do I remedy this? Do I necessarily need to restart logstash each time my mongodb restarts?

Thanks.

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