Module: LogStash::PluginMixins::ECSCompatibilitySupport::TargetCheck

Defined in:
lib/logstash/plugin_mixins/ecs_compatibility_support/target_check.rb

Overview

A target option check that can be included into any LogStash::Plugin.

See Also:

  • ECSCompatibilitySupport()

Constant Summary collapse

TARGET_NOT_SET_MESSAGE =
("ECS compatibility is enabled but `target` option was not specified. " +
"This may cause fields to be set at the top-level of the event where they are likely to clash with the Elastic Common Schema. " +
"It is recommended to set the `target` option to avoid potential schema conflicts (if your data is ECS compliant " +
"or non-conflicting, feel free to ignore this message)").freeze

Class Method Summary collapse

Class Method Details

.included(base) ⇒ void

This method returns an undefined value.



18
19
20
21
22
# File 'lib/logstash/plugin_mixins/ecs_compatibility_support/target_check.rb', line 18

def self.included(base)
  fail(ArgumentError, "`#{base}` must inherit LogStash::Plugin") unless base < LogStash::Plugin
  fail(ArgumentError, "`#{base}` must include #{ECSCompatibilitySupport}") unless base < ECSCompatibilitySupport
  base.prepend(RegisterDecorator)
end