module LogStash::Inputs::Elasticsearch::URIOrEmptyValidator

Public Instance Methods

validate_value(value, validator) click to toggle source

@override to provide :uri_or_empty validator @param value [Array<Object>] @param validator [nil,Array,Symbol] @return [Array(true,Object)]: if validation is a success, a tuple containing ‘true` and the coerced value @return [Array(false,String)]: if validation is a failure, a tuple containing `false` and the failure reason.

Calls superclass method
# File lib/logstash/inputs/elasticsearch.rb, line 674
def validate_value(value, validator)
  return super unless validator == :uri_or_empty

  value = deep_replace(value)
  value = hash_or_array(value)

  return true, value.first if value.size == 1 && value.first.empty?

  return super(value, :uri)
end