Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logstash-output-mongodb - bad file descriptor #46

Open
bluefangs opened this issue Nov 22, 2017 · 2 comments
Open

Logstash-output-mongodb - bad file descriptor #46

bluefangs opened this issue Nov 22, 2017 · 2 comments

Comments

@bluefangs
Copy link

  • Version: 3.1.3
  • Operating System: Ubuntu x64 16.04
  • Config File :
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
        }
    }
}
  • Steps to Reproduce:

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.

@colinsurprenant
Copy link
Contributor

This plugin does not handle disconnect/reconnect. +1 on adding better support for this.

@AJackTi
Copy link

AJackTi commented Sep 24, 2023

Do you have any solutions for this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants