Skip to content

Commit 7200a7a

Browse files
authored
ecs: add v8 alias to v1 implementation (#301)
* ecs: add v8 alias to v1 implementation * version bump and changelog
1 parent 55aac0a commit 7200a7a

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 4.4.0
2+
- Add support for ECS v8 [#301](https://github.com/logstash-plugins/logstash-input-file/pull/301)
3+
14
## 4.3.1
25
- Add extra safety to `chown` call in `atomic_write`, avoiding plugin crashes and falling back to a
36
`non_atomic_write` in the event of failure [#295](https://github.com/logstash-plugins/logstash-input-file/pull/295)

docs/index.asciidoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ This metadata is added after the event has been decoded by the appropriate codec
8787
and will never overwrite existing values.
8888

8989
|========
90-
| ECS Disabled | ECS v1 | Description
90+
| ECS Disabled | ECS `v1`, `v8` | Description
9191

9292
| `host` | `[host][name]` | The name of the {ls} host that processed the event
9393
| `path` | `[log][file][path]` | The full path to the log file from which the event originates
@@ -264,7 +264,7 @@ In practice, this will be the best case because the time taken to read new conte
264264
* Value type is <<string,string>>
265265
* Supported values are:
266266
** `disabled`: sets non-ECS metadata on event (such as top-level `host`, `path`)
267-
** `v1`: sets ECS-compatible metadata on event (such as `[host][name]`, `[log][file][path]`)
267+
** `v1`,`v8`: sets ECS-compatible metadata on event (such as `[host][name]`, `[log][file][path]`)
268268
* Default value depends on which version of Logstash is running:
269269
** When Logstash provides a `pipeline.ecs_compatibility` setting, its value is used as the default
270270
** Otherwise, the default value is `disabled`.

lib/logstash/inputs/file.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ module LogStash module Inputs
8989
class File < LogStash::Inputs::Base
9090
config_name "file"
9191

92-
include PluginMixins::ECSCompatibilitySupport(:disabled, :v1)
92+
include PluginMixins::ECSCompatibilitySupport(:disabled, :v1, :v8 => :v1)
9393

9494
# The path(s) to the file(s) to use as an input.
9595
# You can use filename patterns here, such as `/var/log/*.log`.

logstash-input-file.gemspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Gem::Specification.new do |s|
22

33
s.name = 'logstash-input-file'
4-
s.version = '4.3.1'
4+
s.version = '4.4.0'
55
s.licenses = ['Apache-2.0']
66
s.summary = "Streams events from files"
77
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"
@@ -33,7 +33,7 @@ Gem::Specification.new do |s|
3333

3434
s.add_runtime_dependency 'concurrent-ruby', '~> 1.0'
3535
s.add_runtime_dependency 'logstash-codec-multiline', ['~> 3.0']
36-
s.add_runtime_dependency 'logstash-mixin-ecs_compatibility_support', '~>1.1'
36+
s.add_runtime_dependency 'logstash-mixin-ecs_compatibility_support', '~>1.3'
3737

3838
s.add_development_dependency 'stud', ['~> 0.0.19']
3939
s.add_development_dependency 'logstash-devutils'

spec/inputs/file_tail_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103

104104

105105
context "when path and host fields exist", :ecs_compatibility_support do
106-
ecs_compatibility_matrix(:disabled, :v1) do |ecs_select|
106+
ecs_compatibility_matrix(:disabled, :v1, :v8 => :v1) do |ecs_select|
107107

108108
before(:each) do
109109
allow_any_instance_of(described_class).to receive(:ecs_compatibility).and_return(ecs_compatibility)

0 commit comments

Comments
 (0)