简体   繁体   中英

How to configure filebeat and logstash? 3 VMs

I have 3 VMs and I would like to install logstash locally and filebeat in each VM. I installed filebeat and my filebeat.yml is

filebeat.prospectors:
- input_type: log
paths:
- /path/*.xml
# scan_frequency: 60s
document_type: message
multiline.pattern: '^<measInfo'
multiline.negate: true
multiline.match: after
output.logstash:
    hosts:["my_ip_address:5044"]

I did the same thing for 2 others VM My logstash.conf (running locally) is:

input{
    beats{
    port=>5044
    host=>"ip_address_of_VM"
}}

I run logstash locally and then the filebeat in the VM1 but I get this message error:

Failed to connect: dial tcp my_ip_address:5044: getsockopt: connection refused

It's the correct way? and how I can resolve this problem?

Solved: 
input{
    beats{
    port=>5044
    #host=>"ip_address_of_VM"
}}

Filebeat is running on the VM so the output was the ip of my local machine. But the host( look at my input) of logstash was the ip of the VM. So I just changed the host of logstash and now he is running locally.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM