From 906c1a8da7afe00911ba59b9481cf615373a0f96 Mon Sep 17 00:00:00 2001 From: Andrea Selva Date: Fri, 8 Sep 2023 11:16:39 +0200 Subject: [PATCH] Change codec instance comparison (#69) * Switch from instanceof to string comparision to check the type of codec during regitration * bump to 3.0.6 --------- Co-authored-by: logstashmachine <43502315+logstashmachine@users.noreply.github.com> --- CHANGELOG.md | 3 +++ lib/logstash/outputs/syslog.rb | 2 +- logstash-output-syslog.gemspec | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84b6e1c..f8167c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 3.0.6 + - Change codec instance comparison [#69](https://github.com/logstash-plugins/logstash-output-syslog/pull/69) + ## 3.0.5 - Docs: Set the default_codec doc attribute. diff --git a/lib/logstash/outputs/syslog.rb b/lib/logstash/outputs/syslog.rb index adbd7a9..9b7e4b8 100644 --- a/lib/logstash/outputs/syslog.rb +++ b/lib/logstash/outputs/syslog.rb @@ -132,7 +132,7 @@ def register @ssl_context = setup_ssl end - if @codec.instance_of? LogStash::Codecs::Plain + if @codec.class.name == "LogStash::Codecs::Plain" if @codec.config["format"].nil? @codec = LogStash::Codecs::Plain.new({"format" => @message}) end diff --git a/logstash-output-syslog.gemspec b/logstash-output-syslog.gemspec index 2fac083..f11efa8 100644 --- a/logstash-output-syslog.gemspec +++ b/logstash-output-syslog.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |s| s.name = 'logstash-output-syslog' - s.version = '3.0.5' + s.version = '3.0.6' s.licenses = ['Apache License (2.0)'] s.summary = "Sends events to a `syslog` server" 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"