diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d1678c..2d9de35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 3.4.5 + - Added support for listening on IPv6 addresses + ## 3.4.4 - Refactor: avoid global side-effect + cleanup [#62](https://github.com/logstash-plugins/logstash-input-syslog/pull/62) * avoid setting `BasicSocket.do_not_reverse_lookup` as it has side effects for others diff --git a/lib/logstash/inputs/syslog.rb b/lib/logstash/inputs/syslog.rb index cfff794..5247278 100644 --- a/lib/logstash/inputs/syslog.rb +++ b/lib/logstash/inputs/syslog.rb @@ -138,7 +138,7 @@ def udp_listener(output_queue) @logger.info("Starting syslog udp listener", :address => "#{@host}:#{@port}") @udp.close if @udp - @udp = UDPSocket.new(Socket::AF_INET) + @udp = UDPSocket.new (IPAddr.new(@host).ipv6? rescue nil) ? Socket::AF_INET6 : Socket::AF_INET @udp.do_not_reverse_lookup = true @udp.bind(@host, @port) diff --git a/logstash-input-syslog.gemspec b/logstash-input-syslog.gemspec index f379bd4..affe2f3 100644 --- a/logstash-input-syslog.gemspec +++ b/logstash-input-syslog.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |s| s.name = 'logstash-input-syslog' - s.version = '3.4.4' + s.version = '3.4.5' s.licenses = ['Apache License (2.0)'] s.summary = "Reads syslog messages as events" s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"