# Logstash to Kafka

**URL:** <https://discuss.elastic.co/t/logstash-to-kafka/64361>\
**Category:** Logstash\
**Created:** [October 30, 2016, 3:25am UTC](https://discuss.elastic.co/t/logstash-to-kafka/64361 "2016-10-30T03:25:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kalapakim](https://avatars.discourse-cdn.com/v4/letter/k/3bc359/32.png) [@kalapakim](https://discuss.elastic.co/u/kalapakim)\
**Post date:** [October 30, 2016, 3:25am UTC](https://discuss.elastic.co/t/logstash-to-kafka/64361/1 "2016-10-30T03:25:50Z")

</div>

I am trying to set up logstash, client side, so that logstash can consume logs locally on an application server and send it to kafka. I am pretty new to the ELK stack and could use some guidance on how to do this correctly.

The steps I took to install to windows server:

- installed java
- Create directory for logstash
- downloaded and extracted to the logstash directory
- I created a config file and placed it in the bin directory, of logstash
- started logstash with this command  
`.\logstash.bat -f .\logstash.conf.txt`

the config file looks like this:

```
input {
	file {
		path => "D:\Logs\*.log"
		type => "KawikaTest"
		start_position => "beginning"
		codec => plain{charset => "UTF-16"}        
	}    
}

output {         
	stdout{
		codec => rubydebug
	} 
}

kafka {
	topic_id => "logging_test"
	bootstrap_servers => "SERVERNAME:9092"
}

```

Here is my main issue. I really am not sure how to configure this. I don't totally understand the options. Any assistance with this would be greatly appreciated.

Also, I'd like to know how I can install this as a service...

Thank You!

---

<div class="post-metadata">

**Author:** ![WangXiangUSTC](https://avatars.discourse-cdn.com/v4/letter/w/8dc957/32.png) [@WangXiangUSTC](https://discuss.elastic.co/u/WangXiangUSTC)\
**Post date:** [October 30, 2016, 9:12am UTC](https://discuss.elastic.co/t/logstash-to-kafka/64361/2 "2016-10-30T09:12:58Z")

</div>

you should put the kafka in output，just like below:  
output {  
stdout{  
codec =\> rubydebug  
}  
kafka {  
topic\_id =\> "logging\_test"  
bootstrap\_servers =\> "SERVERNAME:9092"  
}  
}

---

<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:** [July 6, 2017, 4:32am UTC](https://discuss.elastic.co/t/logstash-to-kafka/64361/3 "2017-07-06T04:32:02Z")

</div>


