logstash-plugins / logstash-mixin-ecs_compatibility_support

Support for the ECS-Compatibility mode targeting Logstash 7.7, for plugins wishing to use this API on older Logstashes
Apache License 2.0
0 stars 7 forks source link

Feat: introduce a target check helper #6

Closed kares closed 3 years ago

kares commented 3 years ago

for re-use across plugins - unifying the message, usage:

class LogStash::Filters::Json < LogStash::Filters::Base

  include LogStash::PluginMixins::ECSCompatibilitySupport
  include LogStash::PluginMixins::ECSCompatibilitySupport::TargetCheck

  extend LogStash::PluginMixins::ValidatorSupport::FieldReferenceValidationAdapter

  config :target, :validate => :field_reference
  # ...

  def register
    check_target_set_in_ecs_mode
    # ...
  end

end