Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 3.1.1
- Docs: cover existing ECS `v8` alias to `v1` implementation

## 3.1.0
- Add ECS support. Add `target` option [#20](https://github.com/logstash-plugins/logstash-codec-es_bulk/pull/20)

Expand Down
2 changes: 1 addition & 1 deletion docs/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ When ECS is enabled, the metadata is stored in the `[@metadata][codec][es_bulk]`
* Value type is <<string,string>>
* Supported values are:
** `disabled`: unstructured metadata added at @metadata
** `v1`: uses `[@metadata][codec][es_bulk]` fields
** `v1`,`v8`: uses `[@metadata][codec][es_bulk]` fields

Controls this plugin's compatibility with the {ecs-ref}[Elastic Common Schema (ECS)].

Expand Down
2 changes: 1 addition & 1 deletion logstash-codec-es_bulk.gemspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Gem::Specification.new do |s|

s.name = 'logstash-codec-es_bulk'
s.version = '3.1.0'
s.version = '3.1.1'
s.licenses = ['Apache License (2.0)']
s.summary = "Reads the Elasticsearch bulk format into separate events, along with metadata"
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"
Expand Down
6 changes: 3 additions & 3 deletions spec/codecs/es_bulk_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
require 'logstash/plugin_mixins/ecs_compatibility_support/spec_helper'

describe LogStash::Codecs::ESBulk, :ecs_compatibility_support do
ecs_compatibility_matrix(:disabled, :v1, :v8) do |ecs_select|
ecs_compatibility_matrix(:disabled, :v1, :v8 => :v1) do |ecs_select|

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here pointed out that we want to test with the setting v8.
I believe both ways can test v8, and the mapping gives handy ecs_select.
Do you think testing with (:disabled, :v1, :v8) is more aligned to the test purpose?
(I think my original test which exclude :disabled is wrong anyway)

before(:each) do
allow_any_instance_of(described_class).to receive(:ecs_compatibility).and_return(ecs_compatibility)
end
Expand All @@ -26,7 +26,7 @@
{ "doc" : {"field2" : "value2"} }
HERE

metadata_field = '[@metadata][codec][es_bulk]'
metadata_field = ecs_select[disabled: '[@metadata]', v1:'[@metadata][codec][es_bulk]']

count = 0
subject.decode(data) do |event|
Expand All @@ -51,7 +51,7 @@
end
insist { count } == 4
end
end if ecs_select.active_mode != :disabled
end

context "fail to process non-bulk event then continue" do
it "continues after a fail" do
Expand Down