# Kafka output in Logstash with authentification password and username

**URL:** https://discuss.elastic.co/t/kafka-output-in-logstash-with-authentification-password-and-username/363285
**Category:** Logstash
**Created:** [July 17, 2024, 2:29pm UTC](https://discuss.elastic.co/t/kafka-output-in-logstash-with-authentification-password-and-username/363285 "2024-07-17T14:29:01Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Leo23](https://avatars.discourse-cdn.com/v4/letter/l/258eb7/32.png) [@Leo23](https://discuss.elastic.co/u/Leo23)
#### Post date: [July 17, 2024, 2:29pm UTC](https://discuss.elastic.co/t/kafka-output-in-logstash-with-authentification-password-and-username/363285/1 "2024-07-17T14:29:01Z")

</div>

I see that we can specify username and password in the output Kafka of Filebeat but these fields are not present in the Kafka output of Logstash. What can I do to specify username and password ?

The exemple of input in Filebeat :

> output.kafka:  
> enabled: true  
> hosts: ["\<Kafka\_Broker\_1\>:", "\<Kafka\_Broker\_2\>:"]  
> topic: 'NAME'  
> username: "user"  
> password: "mdp"  
> ssl.endpoint: "https"  
> required\_acks: 1  
> compression: gzip

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [July 17, 2024, 3:20pm UTC](https://discuss.elastic.co/t/kafka-output-in-logstash-with-authentification-password-and-username/363285/2 "2024-07-17T15:20:45Z")

</div>

> [@Leo23](#):
>
> What can I do to specify username and password ?

I think it is going to be something like

```
sasl_mechanism => "PLAIN"
sasl_jaas_config => "org.apache.kafka.common.security.plain.PlainLoginModule required username='username' password='password';"

```
