While we have a large effort in-flight to add ECS v1 support for plugins in advance of Logstash 8's general availability, ECS v8 is set to release along-side Elastic Stack 8, and the delta is currently being scoped and is thus unknown. This means that as we get closer to the release of Logstash 8, we have a pending task to go back and add ECS v8 support to all plugins for which we recently added ECS v1 support.
These changes to the support adapter will allow plugin maintainers to describe ECS v8 as an alias for ECS v1 and provide only the delta in their usage of ecs_select, drastically reducing the overhead of implementing v8.
Where before, plugin maintainers were encouraged to describe the versions that they supported and forced to provide side-by-side implementations for all supported versions to each ecs_select:
require 'logstash/plugin_mixins/ecs_compatibility_support'
class LogStash::Inputs::Foo < Logstash::Inputs::Base
include LogStash::PluginMixins::ECSCompatibilitySupport(:disabled, :v1)
def register
@this = ecs_select[disabled: "old", v1: "new"]
@that = ecs_select[disabled: "legacy", v1: "novel"]
end
end
With these changes maintainers now can describe one implementation in terms of another, providing only the delta:
require 'logstash/plugin_mixins/ecs_compatibility_support'
class LogStash::Inputs::Foo < Logstash::Inputs::Base
include LogStash::PluginMixins::ECSCompatibilitySupport(:disabled, :v1, :v8 => :v1)
def register
@this = ecs_select[disabled: "old", v1: "new"]
@that = ecs_select[disabled: "legacy", v1: "novel", v8:"shiny"]
end
end
Plugin instantiation will be guarded to allow only the supported plugins, and usage of ecs_select will "fall through" the alias chain when a value is not provided. In the example above, when run in the new v8 mode, @this will resolve to "new" by the alias from v8 => v1, while @that will resolve to "shiny" because the value is explicitly given.
Unfortunately, a hash literal with duplicates in Ruby can't be detected. By the time the object is instantiated for us, it has already been deduplicated (last wins).
While we have a large effort in-flight to add ECS v1 support for plugins in advance of Logstash 8's general availability, ECS v8 is set to release along-side Elastic Stack 8, and the delta is currently being scoped and is thus unknown. This means that as we get closer to the release of Logstash 8, we have a pending task to go back and add ECS v8 support to all plugins for which we recently added ECS v1 support.
These changes to the support adapter will allow plugin maintainers to describe ECS v8 as an alias for ECS v1 and provide only the delta in their usage of
ecs_select
, drastically reducing the overhead of implementing v8.Where before, plugin maintainers were encouraged to describe the versions that they supported and forced to provide side-by-side implementations for all supported versions to each
ecs_select
:With these changes maintainers now can describe one implementation in terms of another, providing only the delta:
Plugin instantiation will be guarded to allow only the supported plugins, and usage of
ecs_select
will "fall through" the alias chain when a value is not provided. In the example above, when run in the newv8
mode,@this
will resolve to"new"
by the alias fromv8 => v1
, while@that
will resolve to"shiny"
because the value is explicitly given.