5

I'm trying to send log files from filebeat->logstash->elastic search. filebeat.yml. But I'm getting the following error in filebeat log:

2017-12-07T16:15:38+05:30 ERR  Failed to connect: dial tcp [::1]:5044: connectex: No connection could be made because the target machine actively refused it.

My filebeat and logstash configurations are as follows:

1.filebeat.yml

filebeat.prospectors:

- input_type: log
  paths:
    - C:\Users\shreya\Data\mylog.log 
  document_type: springlog
 multiline.pattern: ^\[[0-9]{4}-[0-9]{2}-[0-9]{2}
  multiline.negate: true
  multiline.match: before
output.logstash:
  hosts: ["localhost:5044"]

2.logstash.yml

    http.host: "127.0.0.1"
    http.port: 5044

3.logstash conf file:

input {
     beats {
        port => 5044
    codec => multiline {
    pattern => "^(%{TIMESTAMP_ISO8601})"
        negate => true
        what => "previous"
    }
  }
}
filter {
    grok{
    id => "myspringlogfilter"
    match => { "message" => "%{TIMESTAMP_ISO8601:timestamp}; [LOG_LEVEL=%{LOGLEVEL:log-level}, CMPNT_NM= %{GREEDYDATA:component}, MESSAGE=%{GREEDYDATA:message}" }
    overwrite => ["message"]

    }

}
output {
    elasticsearch {
        hosts => "localhost:9200" 
        manage_template => false
            index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}" 
        document_type => "%{[@metadata][type]}"     
    }
    stdout {
         codec => rubydebug
  }
}
Siena
  • 778
  • 10
  • 23
  • I'm also similar problem in filebeat. Is available open port 5044? You may try to check it by "telent 127.0.0.1 5044" – sungyong Dec 08 '17 at 02:48
  • was not able to telnet/ netstat the port. probably nothing was running there. But problem got solved. In logstash.yml, I commented out the metric settings. #http.host: "127.0.0.1" and #http.port: 5044. After that worked like a charm – Siena Dec 08 '17 at 09:37

1 Answers1

2

Problem got solved after I commented out the metric settings in logstash.yml as follows:

# ------------ Metrics Settings --------------
#
# Bind address for the metrics REST endpoint
#
#http.host: "127.0.0.1"
#
# Bind port for the metrics REST endpoint, this option also accept a range
# (9600-9700) and logstash will pick up the first available ports.
#
#http.port: 5044
#

But still do not know why this solved the issue. as both(filebeat and logstash) were pointing to the same port. If someone could explain the reason, then prior Thanks!

Siena
  • 778
  • 10
  • 23