# In logstash input, access to amazon msk(kafka)

**URL:** https://discuss.elastic.co/t/in-logstash-input-access-to-amazon-msk-kafka/358276
**Category:** Logstash
**Created:** [April 26, 2024, 8:47am UTC](https://discuss.elastic.co/t/in-logstash-input-access-to-amazon-msk-kafka/358276 "2024-04-26T08:47:05Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![nairobi](https://avatars.discourse-cdn.com/v4/letter/n/f08c70/32.png) [@nairobi](https://discuss.elastic.co/u/nairobi)
#### Post date: [April 26, 2024, 8:47am UTC](https://discuss.elastic.co/t/in-logstash-input-access-to-amazon-msk-kafka/358276/1 "2024-04-26T08:47:05Z")

</div>

I try to get data from amazon managed kafka service named msk.  
That msk using iam.

I set input like below and also put "aws-msk-iam-auth-2.1.0-all.jar" file to logstash module directory.  
logstash input :

```auto
input {
  kafka {
    bootstrap_servers => "msk endpoint"
    security_protocol => "SASL_SSL"
    sasl_mechanism => "AWS_MSK_IAM"
    sasl_jaas_config => "software.amazon.msk.auth.iam.IAMLoginModule required sasl.client.callback.handler.class=software.amazon.msk.auth.iam.IAMClientCallbackHandler;"
    topics => ["topic name"]
    group_id => "group name"
    consumer_threads => 20
    max_poll_records => 1500
  }
}

```

but i got error log like below

```auto
[2024-04-26T08:45:58,354][ERROR][logstash.inputs.kafka] Unable to create Kafka consumer from given configuration {:kafka_error_message=>#<Java::OrgApacheKafkaCommon::KafkaException: Failed to construct kafka consumer>, :cause=>#<Java::OrgApacheKafkaCommon::KafkaException: java.lang.NoClassDefFoundError: Could not initialize class software.amazon.msk.auth.iam.IAMLoginModule>}
[2024-04-26T08:45:58,354][ERROR][logstash.javapipeline] A plugin had an unrecoverable error. Will restart this plugin.

```

please give advice
