elastic / elastic/logstash

Be consistent with how we handle configuration options

Open
#5,117 6 comments 1 reaction 0 assignees View on GitHub
discuss enhancement
Dominant language
Java
Stars
14.9k
Forks
3.5k
Avg merge
19h 14m
Merged PRs (30d)
63

Description

This issue is open to propose a unification process toward the way we handle certain options in plugins, I'm going to focus for now only on host and port options, but I'm sure there are a few others that might benefit from it.

In the case of host connection management, we got different behaviour:
- Elasticsearch Output, moved to a unifed hosts option, see https://github.com/logstash-plugins/logstash-output-elasticsearch/blob/master/lib/logstash/outputs/elasticsearch/common_configs.rb#L82 for more details.
- Redis Output, has something similar, (https://github.com/logstash-plugins/logstash-output-redis/blob/master/lib/logstash/outputs/redis.rb#L36) , but include the option to have a default port (https://github.com/logstash-plugins/logstash-output-redis/blob/master/lib/logstash/outputs/redis.rb#L42) that can be overriten by hostname.
- Redis input, has a host and port options.
- Kafka Input, got a hosts option (https://github.com/logstash-plugins/logstash-input-kafka/blob/master/lib/logstash/inputs/kafka.rb#L34, named zk_connect ) but that is string and not an array.
- TCP Input, gets a host and port options.
- Zabbix Output, got a host and port options, (https://github.com/logstash-plugins/logstash-output-zabbix/blob/master/lib/logstash/outputs/zabbix.rb#L48)

**this is an small subset of plugins, just trying to show the situation**

This give user a contradictory experience as most of people expect to have similar behaviour across logstash plugins, the proposal here is to:
- [ ] See what options can be make consistent.
- [ ] Unify the common options across the set of plugins, we can start with host and and port option to make the interface consistent.
- [ ] Provide a common class, that might be living in core, or in a plugin mixin, to encapsulate this behaviour across plugins.
- [ ] Update the plugins to use this common helper.

What do you think?

Related to: https://github.com/logstash-plugins/logstash-input-redis/issues/24 https://github.com/logstash-plugins/logstash-input-redis/issues/25

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.