Module: LogStash::PluginMixins::ECSCompatibilitySupport::LegacyAdapter::ArgumentValidator
- Defined in:
- lib/logstash/plugin_mixins/ecs_compatibility_support.rb
Overview
Intercepts calls to validate_value(value, validator) whose validator is
the symbol :ecs_compatibility_argument.
Ensures that the provided value is either:
- the literal
disabled; OR - a v-prefixed integer (e.g.,
v1)
Instance Method Summary collapse
Instance Method Details
#validate_value(value, validator) ⇒ Object
87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/logstash/plugin_mixins/ecs_compatibility_support.rb', line 87 def validate_value(value, validator) return super unless validator == :ecs_compatibility_argument value = deep_replace(value) value = hash_or_array(value) if value.size == 1 return true, :disabled if value.first.to_s == 'disabled' return true, value.first.to_sym if value.first.to_s =~ V_PREFIXED_INTEGER_PATTERN end return false, "Expected a v-prefixed integer major-version number (e.g., `v1`) or the literal `disabled`, got #{value.inspect}" end |