I want filebeat and logstash to communicate with each other to collect multiple log files.
I have run the following test command for filebeat, but the connection is refused.
What is the reason for this?
filebeat -e -c filebeat.yml test output
I will report the error, the yml file used for testing, and the status of the open 5044port.
# filebeat -e -c filebeat.yml test output
2021-03-03T20:24:39.255+0900 INFO instance/beat.go:660 Home path: [/usr/share/filebeat] Config path: [/etc/filebeat] Data path: [/var/lib/filebeat] Logs path: [/var/log/filebeat]
2021-03-03T20:24:39.255+0900 INFO instance/beat.go:668 Beat ID: ****
logstash: ***.***.***.***:5044...
connection...
parse host... OK
dns lookup... OK
addresses: ***.***.***.***
dial up... ERROR dial tcp ***.***.***.***:5044: connect: connection refused
# cat filebeat.yml
filebeat.inputs:
- type: log
enabled: true
paths:
- /var/log/nginx/access.log*
tags: ["nginx-access"]
exclude_files: ['.gz$']
output.logstash:
hosts: ["***.***.***.***:5044"]
filebeat.config.modules:
enabled: true
path: ${path.config}/modules.d/*.yml
# firewall-cmd --add-port=5044/tcp --permanent
success
# firewall-cmd --reload
success
# firewall-cmd --list-ports --permanent
5044/tcp