logstash-plugins / logstash-filter-elasticsearch

Elasticsearch filter for Logstash
Apache License 2.0
21 stars 83 forks source link

validate query and query_template settings #171

Closed kaisecheng closed 1 year ago

kaisecheng commented 1 year ago

This commit adds checking to ensure either query or query_template is non empty. If both are set, the plugin throws error

Fix #170

kaisecheng commented 1 year ago

I was thinking to set a default value for query like es-input, but agree with your point that better to prevent both values are set unintentionally.

Prior to the change, user is allowed to set both, and query_template takes precedence. Any concerns regarding throwing an error when both are set? This could break the current setting if users have both in place. Instead of throwing an error, maybe a warning message is enough?