Filebeat error when trying to send logs from filebeat to logstash

I am getting this error when I am trying to send logs from filebeat to logstash.

Failed to connect: dial tcp 127.0.0.1:5044: connectex: No connection could be made because the target machine actively refused it.

Please help me out with this.

Thank you

Could you please share you debug logs and configuration? Please format these using </>.

This is my filebeat.yml configuration:

<filebeat.prospectors:

  • type: log
    enabled: true
    paths:
    • C:\Users\abccsh\Documents\My Received Files\sample.log
      filebeat.config.modules:
      path: ${path.config}/modules.d/*.yml
      reload.enabled: true
      output.logstash:
      hosts: ["localhost:5044"]/>

my logstash conf file:
input {
beats {
port => 5044
}
}
output{
elasticsearch {
hosts => "localhost:9200"
index => "reshma"
user=> elastic
password=>elastic
}
stdout{codec => rubydebug}
}

Debug logs:

cfgfile/reload.go:77 BETA: Dynamic config reload is enabled.
2018-05-24T09:57:55.518+0530 INFO crawler/crawler.go:82 Loading and starting Prospectors completed. Enabled prospectors: 1
2018-05-24T09:57:55.518+0530 INFO cfgfile/reload.go:127 Config reloader started
2018-05-24T09:57:55.520+0530 INFO log/harvester.go:216 Harvester started for file: C:\Users\rmorampu\Documents\My Received Files\sample.log
2018-05-24T09:57:58.591+0530 ERROR pipeline/output.go:74 Failed to connect: dial tcp 127.0.0.1:5044: connectex: No connection could be made because the target machine actively refused it.
2018-05-24T09:58:02.622+0530 ERROR pipeline/output.go:74 Failed to connect: dial tcp 127.0.0.1:5044: connectex: No connection could be made because the target machine actively refused it.
2018-05-24T09:58:08.660+0530 ERROR pipeline/output.go:74 Failed to connect: dial tcp [::1]:5044: connectex: No connection could be made because the target machine actively refused it.

@remo You can verify the log shipment from Filebeat to Logstash without using Elasticsearch. Sometime if Elasticsearch is not working properly with Logstash then this kind of problem may arise.

You can verify it by following below steps:

  1. Configure stdout in output section of logstash
    output {
    stdout{}
    }

  2. Restart Logstash

  3. Run Filebeat

[Note : If it is working fine then it is the problem regarding Elasticsearch and Logstash]

You can Follow the start sequence accordingly
Elasticsearch --> Logstash --> Filebeat

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