I am trying to install ELK in Docker Swarm mode.
Then, I need to tell filebeat to send logs to logstash.
Here is my filebeat config file:
#=========================== Filebeat prospectors =============================
## Each - is a prospector. Most options can be set at the prospector level, so
## you can use different prospectors for various configurations.
## Below are the prospector specific configurations.
filebeat.prospectors:
- input_type: log
enabled: true
paths:
{% for log in in_filebeat_dict.filebeat.logs | default([]) %}
- {{ log }}
{% endfor %}
#================================ Outputs =====================================
# Configure what output to use when sending the data collected by the beat.
output.logstash:
hosts: ["{{ in_filebeat_dict.filebeat.output.logstash }}:{{ in_filebeat_dict.filebeat.output.port}}"]
but in_filebeat_dict.filebeat.output.logstash
is an IP and in Swarm mode, Swarm will not decide where to install containers, so I'm a bit stuck here...
Any ideas ???
In swarm mode discovery works over ne --name
parameter. So when you deploy logstash with --name logstash
other services can access it by calling the name logstash
. But remember, they need to be in the same network which is not ingress. Create a new overlay network if you haven't done it yet and assign all services to that.