How to receive logs from multiple filebeats running on different machine(ec2) to one logstash instance?

i have 2 filebeats running on different machine(Ex: A & B) and I have also specified the logstash machine IP in filebeat.yaml

so i have written 2 logstash .conf file .

My conf file looks like this ->

A.conf

input{ beat{ port:"" host:"private-ip-m1" } }

B.conf

input{ beat{ port:"" host:"private-ip-m2" } }

after I run logstash it is unable to connect. it says Error: Cannot assign requested address.

Can anyone tell me is there any other way to this ?

What are the private-ip-m1 and private-ip-m2?

Your error means that one of IP address that yo uset in the host option does not exist in the logstash instance.

Also, why are you using two beats input in the same logstash? You can use just one beats input.

You do not need to set host option of the beats input, remove it and Logstash will listen to the specified port in all available IPs of the instance. If you want to set it, you need to use an available IP in the instance.

private-ip-m1 and private-ip-m2 i meant Amazon ec2 instance ip address. i have installed filebeats in these two ec2 instances.

You don't put the source metricbeat IPs in the beats input just port 5044.

Then each metricbeat.yml set the output.logstash to point to the IP of the logstash.

Actually, I'm getting the logs from those 2 file beats to logstash but all logs are stored in one index but I want to create two different index names for logs coming from those 2 machines. How can I do that?

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