Hi folks,
Kafka output plugin is working perfectly on Linux but it seems not working correctly on Windows, not sure how to debug it.
When I make test on Linux, it's working fine:
- Linux(CentOS6.5/ jdk-8u45/ kafka_2.10-0.8.2.1/ logstash-1.5.2/ IP: 10.10.50.58):
Input console, I type 'Hi, there!':
[root@es-node-02 logstash-1.5.2]# bin/logstash -e "input { stdin {} } output { kafka { topic_id => 'logstash_logs' } }"
Logstash startup completed
Hi, there!
Output console, result be printed:
[root@es-node-02 logstash-1.5.2]# bin/logstash -e "input { kafka { topic_id => 'logstash_logs' } } output { stdout { codec => rubydebug } }"
Logstash startup completed
{
"message" => "Hi, there!",
"@version" => "1",
"@timestamp" => "2015-07-09T15:30:15.444Z",
"host" => "es-node-02"
}
- Windows(Windows Server 2008 R2/ jdk-8u45/ logstash-1.5.2/ IP: 10.10.20.117)
However, when I make same test on Windows. When I type 'Hi', there is no result be printed at output console.
C:\logstash\bin\logstash.conf:
input { stdin {} }
output {
stdout { codec => rubydebug }
kafka {
broker_list => "10.10.50.58:9092"
topic_id => "logstash_logs"
codec => plain {
format => "%{message}"
}
}
}
Execute Logstash via cmd:
c:\logstash\bin>logstash agent -f logstash.conf --log c:\logstash\log\logstash.log
io/console not supported; tty will not be manipulated
Sending logstash logs to c:\logstash\log\logstash.log.
Hi
{
"message" => "Hi\r",
"@version" => "1",
"@timestamp" => "2015-07-09T15:41:08.580Z",
"host" => "NHST-VM-WEB02"
}
Error Log(logstash.log) shows:
{:timestamp=>"2015-07-09T23:41:13.791000+0800", :message=>"kafka producer threw exception, restarting", :exception=>kafka.common.FailedToSendMessageException: Failed to send messages after 3 tries., :level=>:warn}
Kafka INFO(IP: 10.10.50.58):
[2015-07-09 23:41:12,678] INFO Closing socket connection to /10.10.20.117. (kafka.network.Processor)
[2015-07-09 23:41:13,953] INFO Closing socket connection to /10.10.20.117. (kafka.network.Processor)
[2015-07-09 23:41:15,075] INFO Closing socket connection to /10.10.20.117. (kafka.network.Processor)
[2015-07-09 23:41:16,195] INFO Closing socket connection to /10.10.20.117. (kafka.network.Processor)
[2015-07-09 23:41:17,339] INFO Closing socket connection to /10.10.20.117. (kafka.network.Processor)