logstash-plugins / logstash-output-elastic_app_search

Apache License 2.0
0 stars 9 forks source link

Possibility to set engine parameter dynamically #22

Closed lengoyvaerts closed 3 years ago

lengoyvaerts commented 3 years ago

When trying to use a dynamic value for the engine parameter like this:

elastic_app_search {
    api_key => "private-xxxxxxxxxxx"
    engine => "%{[engine]}"
    document_id => "%{[id]}"
    url => "https://xxxxxxxxxxx.es.io"
}

I get the following error when starting Logstash:

<LogStash::ConfigurationError: Failed to connect to App Search. bad URI(is not URI?): https://redacted/api/as/v1/engines/%{[engine]}>

I checked the code and see an intial connection check is being made:

def check_connection!
    @client.get_engine(@engine)
end

Is it possible to change this check to, let's say, the authentication check described here, to allow dynamic values for the engine?

andsel commented 3 years ago

Thanks @lengoyvaerts to have open this discussion. The idea seems great, I'll try to come out with a PR on this.

petericebear commented 3 years ago

Chimming in on this update for alerts