Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for the custom client and login callback handler for the kafka-output #102

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Next
- [DOC] Updates description of `enable_auto_commit=false` to clarify that the commit happens after data is fetched AND written to the queue [#90](https://github.com/logstash-plugins/logstash-integration-kafka/pull/90)
- [Doc] Added support for the custom client and login callback handler for the kafka-output

## 10.8.1
- [DOC] Removed a setting recommendation that is no longer applicable for Kafka 2.0+ [#99](https://github.com/logstash-plugins/logstash-integration-kafka/pull/99)
Expand Down
6 changes: 6 additions & 0 deletions lib/logstash/outputs/kafka.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ class LogStash::Outputs::Kafka < LogStash::Outputs::Base
config :sasl_jaas_config, :validate => :string
# Optional path to kerberos config file. This is krb5.conf style as detailed in https://web.mit.edu/kerberos/krb5-1.12/doc/admin/conf_files/krb5_conf.html
config :kerberos_config, :validate => :path
# Custom sasl client callback handler class.
config :sasl_client_callback_handler_class, :validate => :string
# Custom sasl login callback handler class.
config :sasl_login_callback_handler_class, :validate => :string

# The topic to produce messages to
config :topic_id, :validate => :string, :required => true
Expand Down Expand Up @@ -362,6 +366,8 @@ def create_producer
elsif security_protocol == "SASL_PLAINTEXT"
set_sasl_config(props)
elsif security_protocol == "SASL_SSL"
props.put("sasl.client.callback.handler.class",sasl_client_callback_handler_class) unless sasl_client_callback_handler_class.nil?
props.put("sasl.login.callback.handler.class",sasl_login_callback_handler_class) unless sasl_login_callback_handler_class.nil?
set_trustore_keystore_config(props)
set_sasl_config(props)
end
Expand Down