# Sending topbeat events to kafka

**URL:** <https://discuss.elastic.co/t/sending-topbeat-events-to-kafka/45988>\
**Category:** Beats\
**Created:** [March 31, 2016, 7:16pm UTC](https://discuss.elastic.co/t/sending-topbeat-events-to-kafka/45988 "2016-03-31T19:16:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jstar](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@jstar](https://discuss.elastic.co/u/jstar)\
**Post date:** [March 31, 2016, 7:16pm UTC](https://discuss.elastic.co/t/sending-topbeat-events-to-kafka/45988/1 "2016-03-31T19:16:05Z")

</div>

Hi all,

I'm trying to send topbeat's events to kafka. This is what I have done so far, download the nightly version with

```
wget https://beats-nightlies.s3.amazonaws.com/topbeat/topbeat_5.0.0-nightlylatest_amd64.deb

```

then installed it with dpkg -i. I'm using the nightly version because that is the version that support kafka integration.

I then configured topbeat as follows

```
topbeat:
  period: 10

  procs: [".*"]

  stats:
    system: true

    proc: true

    filesystem: true

    cpu_per_core: false

output:
  ### kafka as output
  kafka:
    # The kafka hosts
    hosts: ["localhost:9092"]

    # kafka topic 
    topic: "toptopic"

shipper:
  fields_under_root: true
  fields:
    custom_field: my-custom_field

  output:
    console:
      pretty: true

logging:

  files:
    rotateeverybytes: 10485760 # = 10MB

```

When I try to consume the messages of the topic toptopic, I see nothing inside the topic. I know that the kafka plugin is actaully taken into consideration because when I go to the directory /etc/topbeat and run topbaet in the debug with the command

```
topbeat -c topbeat.yml -e -d "*"

```

I see the follow in the logs

```
2016/03/31 18:29:34.324604 log.go:16: WARN kafka message: [Initializing new client]
2016/03/31 18:29:34.324695 log.go:12: WARN client/metadata fetching metadata for all topics from broker [localhost:9092]
2016/03/31 18:29:34.325378 outputs.go:87: INFO Activated kafka as output plugin.
2016/03/31 18:29:34.325423 publish.go:231: DBG Create output worker
2016/03/31 18:29:34.325488 publish.go:273: DBG No output is defined to store the topology. The server fields might not be filled.
2016/03/31 18:29:34.325558 publish.go:287: INFO Publisher name: ip-172-31-42-120
2016/03/31 18:29:34.325713 async.go:70: INFO Flush Interval set to: 277777h46m40s
2016/03/31 18:29:34.325754 async.go:71: INFO Max Bulk Size set to: 2048
2016/03/31 18:29:34.325789 async.go:79: DBG create bulk processing worker (interval=277777h46m40s, bulk size=2048)
2016/03/31 18:29:34.325888 beat.go:246: INFO topbeat start running.
 2016/03/31 18:29:34.342815 log.go:12: WARN Connected to broker at [localhost:9092] (unregistered)
2016/03/31 18:29:34.359540 log.go:12: WARN client/brokers registered new broker #[0 %!d(string=private_ip:9092)] at %!s(MISSING)
2016/03/31 18:29:34.359606 log.go:16: WARN kafka message: [Successfully initialized new client]

```

What am I missing.

Any helps will be welcoming.  
Thanks very much.

---

<div class="post-metadata">

**Author:** ![jstar](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@jstar](https://discuss.elastic.co/u/jstar)\
**Post date:** [March 31, 2016, 8:03pm UTC](https://discuss.elastic.co/t/sending-topbeat-events-to-kafka/45988/2 "2016-03-31T20:03:12Z")

</div>

Hi  
I finally get it working. Knowing that topbeat was supposed to publish its events to kafka, the trick was to remove the tags output

```
 output:
    console:
       pretty: true

```

In the configuration file of topbeat.

Hope this helps someone in the future.

---

<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 5, 2017, 9:54pm UTC](https://discuss.elastic.co/t/sending-topbeat-events-to-kafka/45988/3 "2017-07-05T21:54:00Z")

</div>


