From 2d6a7dff0066c59a77745dc34f0d53806ce4f30b Mon Sep 17 00:00:00 2001 From: Rye Biesemeyer Date: Fri, 4 Apr 2025 10:39:22 -0700 Subject: [PATCH 1/2] ecs: remove warning when using v8 --- CHANGELOG.md | 3 +++ lib/logstash/filters/grok.rb | 6 ++---- logstash-filter-grok.gemspec | 2 +- spec/filters/grok_spec.rb | 20 -------------------- 4 files changed, 6 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6f29fd..803f35a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 4.4.4 + - Removed warning about ECS v8 being a preview + ## 4.4.3 - Minor typos in docs examples [#176](https://github.com/logstash-plugins/logstash-filter-grok/pull/176) diff --git a/lib/logstash/filters/grok.rb b/lib/logstash/filters/grok.rb index 3544401..b1e07cd 100644 --- a/lib/logstash/filters/grok.rb +++ b/lib/logstash/filters/grok.rb @@ -330,10 +330,8 @@ def patterns_path case ecs_compatibility when :disabled patterns_path << LogStash::Patterns::Core.path # :legacy - when :v1 - patterns_path << LogStash::Patterns::Core.path('ecs-v1') - when :v8 - @logger.warn("ECS v8 support is a preview of the unreleased ECS v8, and uses the v1 patterns. When Version 8 of the Elastic Common Schema becomes available, this plugin will need to be updated") + when :v1, :v8 + # v8 is an alias for v1; there were no relevant material changes to the schema patterns_path << LogStash::Patterns::Core.path('ecs-v1') else fail(NotImplementedError, "ECS #{ecs_compatibility} is not supported by this plugin.") diff --git a/logstash-filter-grok.gemspec b/logstash-filter-grok.gemspec index 5ccb55f..b4988bf 100644 --- a/logstash-filter-grok.gemspec +++ b/logstash-filter-grok.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'logstash-filter-grok' - s.version = '4.4.3' + s.version = '4.4.4' s.licenses = ['Apache License (2.0)'] s.summary = "Parses unstructured event data into fields" 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" diff --git a/spec/filters/grok_spec.rb b/spec/filters/grok_spec.rb index f83df51..a45e62c 100644 --- a/spec/filters/grok_spec.rb +++ b/spec/filters/grok_spec.rb @@ -774,26 +774,6 @@ def self.sample(message, &block) end -describe LogStash::Filters::Grok do - - subject(:grok_filter) { described_class.new(config) } - let(:config) { {} } - - context 'when initialized with `ecs_compatibility => v8`' do - let(:config) { super().merge("ecs_compatibility" => "v8", "match" => ["message", "%{SYSLOGLINE}"]) } - context '#register' do - let(:logger_stub) { double('Logger').as_null_object } - before(:each) { allow_any_instance_of(described_class).to receive(:logger).and_return(logger_stub)} - - it 'logs a helpful warning about the unreleased v8' do - grok_filter.register - - expect(logger_stub).to have_received(:warn).with(a_string_including "preview of the unreleased ECS v8") - end - end - end -end - describe LogStash::Filters::Grok do describe "(LEGACY)" do describe "patterns in the 'patterns/' dir override core patterns" do From e3ee18084e27c17242569a411ab9449a368e09b7 Mon Sep 17 00:00:00 2001 From: Rye Biesemeyer Date: Fri, 4 Apr 2025 10:42:12 -0700 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 803f35a..d461844 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ ## 4.4.4 - - Removed warning about ECS v8 being a preview + - Removed warning about ECS v8 being a preview [#195](https://github.com/logstash-plugins/logstash-filter-grok/pull/195) ## 4.4.3 - Minor typos in docs examples [#176](https://github.com/logstash-plugins/logstash-filter-grok/pull/176)