# Logstash -- \>kafka --\> logstash

**URL:** <https://discuss.elastic.co/t/logstash-kafka-logstash/92361>\
**Category:** Logstash\
**Created:** [July 8, 2017, 1:33pm UTC](https://discuss.elastic.co/t/logstash-kafka-logstash/92361 "2017-07-08T13:33:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rsthakur83](https://avatars.discourse-cdn.com/v4/letter/r/ce7236/32.png) [@rsthakur83](https://discuss.elastic.co/u/rsthakur83)\
**Post date:** [July 8, 2017, 1:33pm UTC](https://discuss.elastic.co/t/logstash-kafka-logstash/92361/1 "2017-07-08T13:33:10Z")

</div>

Hi ,

Can someone suggest the step to achieve the below requirement.

1. Logstash collect the logs from apache, application server and pushing to kafka
2. kafka accepting the logs from logstash as input stream and forward it to other logstash server ?

Please share the configuration for both producer , consumer and how we can check at kafka server that logs are coming from source logstash ?

Thanks  
Ravinder

---

<div class="post-metadata">

**Author:** ![Vishal\_Sharma1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vishal_sharma1/32/20207_2.png) [@Vishal\_Sharma1](https://discuss.elastic.co/u/Vishal_Sharma1)\
**Post date:** [July 9, 2017, 1:53pm UTC](https://discuss.elastic.co/t/logstash-kafka-logstash/92361/2 "2017-07-09T13:53:48Z")

</div>

For Logstash read below

[https://www.elastic.co/guide/en/logstash/current/index.html](https://www.elastic.co/guide/en/logstash/current/index.html)

For Kafka

[https://www.elastic.co/guide/en/logstash/current/plugins-inputs-kafka.html](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-kafka.html)

[https://www.elastic.co/guide/en/logstash/current/plugins-outputs-kafka.html](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-kafka.html)

---

<div class="post-metadata">

**Author:** ![rsthakur83](https://avatars.discourse-cdn.com/v4/letter/r/ce7236/32.png) [@rsthakur83](https://discuss.elastic.co/u/rsthakur83)\
**Post date:** [July 9, 2017, 2:19pm UTC](https://discuss.elastic.co/t/logstash-kafka-logstash/92361/3 "2017-07-09T14:19:17Z")

</div>

Thanks Vishal for the reply

---

<div class="post-metadata">

**Author:** ![inhinyera16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inhinyera16/32/61625_2.png) [@inhinyera16](https://discuss.elastic.co/u/inhinyera16)\
**Post date:** [July 10, 2017, 3:53am UTC](https://discuss.elastic.co/t/logstash-kafka-logstash/92361/4 "2017-07-10T03:53:46Z")

</div>

So basically, you wanted to accomplish this flow

application server =\> logstash (producer) =\> kafka server =\> logstash (consumer)

Here's the config for kafka as producer. It will output to kafka server

output  
{  
kafka {  
topic\_id =\> "topicname"  
}  
}

While this one gets the data from kafka server

input {  
kafka {  
topics =\> ["topicname"]  
}  
}

You can view incoming datas in the kafka server using elasticsearch as output of your consumer.

---

<div class="post-metadata">

**Author:** ![rsthakur83](https://avatars.discourse-cdn.com/v4/letter/r/ce7236/32.png) [@rsthakur83](https://discuss.elastic.co/u/rsthakur83)\
**Post date:** [July 10, 2017, 7:45am UTC](https://discuss.elastic.co/t/logstash-kafka-logstash/92361/5 "2017-07-10T07:45:01Z")

</div>

Thanks Archelle for the reply.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 7, 2017, 7:45am UTC](https://discuss.elastic.co/t/logstash-kafka-logstash/92361/6 "2017-08-07T07:45:02Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
