Hi,
I have two pipeline configurations located in /etc/logstash/conf.d
. I can make work both seperately by running /usr/share/logstash/bin/logstash -f /etc/logstash/conf.d/**.conf -r
, and it sends data to elasticsearch as I want. When I try to run both together (with pipeline.yml), I get an error.
The input of the problematic pipeline esxi.conf is :
input{
udp {
host => "myip"
port => "514"
}
}
Here's my pipeline.yml :
- pipeline.id: switch
path.config: "/etc/logstash/conf.d/switch.conf"
- pipeline.id: esxi
path.config: "/etc/logstash/conf.d/esxi.conf"
And here's the error I get when I try to run logstash (with systemctl start logstash
) :
sept. 13 12:30:25 local logstash[4303]: [2022-09-13T12:30:25,350][ERROR][logstash.inputs.udp]
[esxi-pipeline][5beb5edfc5ff315c8ba13ccf64d80fa654d6b00786d512a26d6639b7cbfeea2f] UDP listener died
{:exception=>#<Errno::EADDRINUSE: Address already in use - bind - Permission non accordée
bind(2) for "myip" port 514>, :backtrace=>["org/jruby/ext/socket/RubyUDPSocket.java:200:in `bind'",
"/usr/share/logstash/vendor/bundle/jruby/2.6.0/gems/logstash-input-udp-3.5.0/lib/logstash/inputs/udp.rb:129:in `udp_listener'",
"/usr/share/logstash/vendor/bundle/jruby/2.6.0/gems/logstash-input-udp-3.5.0/lib/logstash/inputs/udp.rb:81:in `run'",
"/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:410:in `inputworker'",
"/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:401:in `block in start_input'"]}
The switch logs are correctly ingested so I don't think that the problem is Logstash or my pipeline config.
What I don't understand is that the 514 port is not in use. Rsyslog is disabled and with netstat -tulpn
, there's no mention of 514. And by running alone esxi.conf, it's working as supposed to work.
I rebooted ; I tried to allow ports below 1024 to non-root users with setcap cap_net_bind_service /usr/share/logstash/bin/logstash
and with other file paths but it just broke everything. (Same problem as here : logstash will not open a listening port. · Issue #1587 · elastic/logstash · GitHub)
Is there a way to make it work ?
Thanks for your help !