# Logstash kafka output works but kafka input doesn't

**URL:** <https://discuss.elastic.co/t/logstash-kafka-output-works-but-kafka-input-doesnt/98235>\
**Category:** Logstash\
**Created:** [August 24, 2017, 12:52pm UTC](https://discuss.elastic.co/t/logstash-kafka-output-works-but-kafka-input-doesnt/98235 "2017-08-24T12:52:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![foresightyj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/foresightyj/32/3666_2.png) [@foresightyj](https://discuss.elastic.co/u/foresightyj)\
**Post date:** [August 24, 2017, 12:52pm UTC](https://discuss.elastic.co/t/logstash-kafka-output-works-but-kafka-input-doesnt/98235/1 "2017-08-24T12:52:13Z")

</div>

I have been using logstash for the past two years and consider myself to be fairly familiar with configurations. Actually this configuration worked before and just stopped working a few days ago.

To make a minimal case, I downloaded the latest logstash 5.5.2, and start new with this config:

```
input { 
    kafka {
        topics => ["test_kafka_logstash_2"]
        bootstrap_servers => "192.168.0.112:9092"
        id => "test_kafka_input"
        auto_offset_reset => "latest"

    }
    
    stdin {
        id => "test_stdin"
    }

}
filter {
    mutate {
        add_field => { "hello" => "world" }
    }
}

output {
    stdout { codec => rubydebug }
    
    kafka {
        codec => plain {
            format => "%{message}"
        }
        topic_id => "test_logstash_kafka_output"
        bootstrap_servers => "192.168.0.112:9092"
        id => "test_kafka_output"
    }
}

```

Run it with this command:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/d/9d6d0714de7dc9edc6078780004858c7aa1355ef.png)

Then enter two lines:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/6/36f6a47b59556553c604d9ad6d9d61072f84b5fc.png)

And the proof that the two lines were written to the output kafka topic successfully

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/2/b252246cdf8d46855e844ef5ba96d404c5484b46.png)

Exactly two lines are written to the output topic.

Now for the kafka input, I have script that writes to the `test_kafka_logstash_2` topic and this is total count of messages after the test:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/7/f7585eb581b96235ee3e1a97e122d21142f9c47b.png)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/c/4c8586d4445aa1eaa2695753942b4fe43aa378d1.png)

Below is the complete log that is logged:

> <https://gist.github.com/foresightyj/5037361e2d81b1ad7746c3e24241b67f>

---

<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:** [September 21, 2017, 12:52pm UTC](https://discuss.elastic.co/t/logstash-kafka-output-works-but-kafka-input-doesnt/98235/2 "2017-09-21T12:52:28Z")

</div>

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