# Kafkabeat - help

**URL:** <https://discuss.elastic.co/t/kafkabeat-help/60724>\
**Category:** Beats\
**Created:** [September 16, 2016, 2:40pm UTC](https://discuss.elastic.co/t/kafkabeat-help/60724 "2016-09-16T14:40:23Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_McClain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_mcclain/32/8613_2.png) [@David\_McClain](https://discuss.elastic.co/u/David_McClain)\
**Post date:** [September 16, 2016, 2:40pm UTC](https://discuss.elastic.co/t/kafkabeat-help/60724/1 "2016-09-16T14:40:23Z")

</div>

I am trying to follow the blog guide about Kafka:

> **[Just Enough Kafka For The Elastic Stack, Part 2](https://www.elastic.co/blog/just-enough-kafka-for-the-elastic-stack-part2)**
>
> Are you running Apache Kafka with your Elastic Stack? Here's part 2 of the series which talks about operations and production deployment tips.

  
to start collecting some Kafka stats.

I have basic experience with Beats via using the yum repos for installation.  
No Beats development experience.  
When I run the make command as instructed in the guide, the following error:

```auto
glide update --no-recursive
make: glide: Command not found
make: *** [init] Error 127

```

I guess there's an assumption that the reader has some knowledge that I personally don't have.  
I haven't found any topics on the forums here regarding Kafkabeat, and there isn't much info on google either regarding that error.

Any help would be appreciated.

Thanks

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [September 18, 2016, 7:26pm UTC](https://discuss.elastic.co/t/kafkabeat-help/60724/2 "2016-09-18T19:26:21Z")

</div>

This doesn't appear to be mentioned in the Kafkabeat documentation, but [CONTRIBUTING.md](http://CONTRIBUTING.md) in the Beats repository notes that you need to install [glide](https://github.com/Masterminds/glide).

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [September 19, 2016, 7:04am UTC](https://discuss.elastic.co/t/kafkabeat-help/60724/3 "2016-09-19T07:04:50Z")

</div>

@David_McClain Let me know if it worked with the installation of glide recommended by @magnusbaeck The non community beats have the dependencies checked in so no glide to just build it is needed. In the past we recommended for the community beats to use glide and that is when kafkabeat was built.

---

<div class="post-metadata">

**Author:** ![David\_McClain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_mcclain/32/8613_2.png) [@David\_McClain](https://discuss.elastic.co/u/David_McClain)\
**Post date:** [September 19, 2016, 11:41am UTC](https://discuss.elastic.co/t/kafkabeat-help/60724/4 "2016-09-19T11:41:12Z")

</div>

I'll be looking at it a little later this morning thanks.  
Can you clarify on your phrase

> so no glide to just build it is needed

Thanks

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [September 19, 2016, 11:55am UTC](https://discuss.elastic.co/t/kafkabeat-help/60724/5 "2016-09-19T11:55:21Z")

</div>

Non-community beats no longer depend on glide for building but community beats like Kafkabeat might still use glide.

---

<div class="post-metadata">

**Author:** ![David\_McClain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_mcclain/32/8613_2.png) [@David\_McClain](https://discuss.elastic.co/u/David_McClain)\
**Post date:** [September 19, 2016, 2:44pm UTC](https://discuss.elastic.co/t/kafkabeat-help/60724/6 "2016-09-19T14:44:15Z")

</div>

Ok, I've installed Go, and Glide.  
I'm on Centos 6.7.  
I made sure that $GOPATH/github.com/gingerwizard exist (as per the README)  
I also created $GOPATH/src , $GOPATH/bin , and $GOPATH/pkg

When I run

```auto
make init

```

again as per the README

I get this output resulting in an error:

```auto
make init
glide update --no-recursive
[INFO] Downloading dependencies. Please wait...
[INFO] --> Fetching updates for github.com/elastic/beats.
[INFO] --> Fetching updates for github.com/Shopify/sarama.
[INFO] --> Fetching updates for github.com/davecgh/go-spew.
[INFO] --> Fetching updates for github.com/eapache/queue.
[INFO] --> Fetching updates for github.com/eapache/go-resiliency.
[INFO] --> Fetching updates for github.com/golang/snappy.
[INFO] --> Fetching updates for github.com/wvanbergen/kazoo-go.
[INFO] --> Fetching updates for github.com/samuel/go-zookeeper.
[INFO] --> Fetching updates for github.com/klauspost/crc32.
[INFO] --> Setting version for github.com/elastic/beats to d8ca37efa8888ce624e2cfaa90107e79fd41be1e.
[INFO] Exporting resolved dependencies...
[INFO] --> Exporting github.com/elastic/beats
[INFO] --> Exporting github.com/Shopify/sarama
[INFO] --> Exporting github.com/golang/snappy
[INFO] --> Exporting github.com/davecgh/go-spew
[INFO] --> Exporting github.com/wvanbergen/kazoo-go
[INFO] --> Exporting github.com/eapache/queue
[INFO] --> Exporting github.com/samuel/go-zookeeper
[INFO] --> Exporting github.com/eapache/go-resiliency
[INFO] --> Exporting github.com/klauspost/crc32
[INFO] Replacing existing vendor dependencies
[WARN] Skipping lockfile generation because full dependency tree is not being calculated
make update
make[1]: Entering directory `/opt/beats/kafkabeat/kafkabeat'
bash ./vendor/github.com/elastic/beats/libbeat/scripts/update.sh kafkabeat github.com/gingerwizard/kafkabeat ./vendor/github.com/elastic/beats/libbeat
Beat name: kafkabeat
Beat path: ../kafkabeat
Start modifying beat
Update config file
Update fields
Traceback (most recent call last):
  File "./vendor/github.com/elastic/beats/libbeat/scripts/generate_fields_docs.py", line 129, in <module>
    fields_to_asciidoc(input, output, beat_name.title())
  File "./vendor/github.com/elastic/beats/libbeat/scripts/generate_fields_docs.py", line 99, in fields_to_asciidoc
    output.write("* <<exported-fields-{}>>\n".format(doc))
ValueError: zero length field name in format
make[1]: *** [update] Error 1
make[1]: Leaving directory `/opt/beats/kafkabeat/kafkabeat'
make: *** [init] Error 2

```

Thanks

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [September 19, 2016, 2:47pm UTC](https://discuss.elastic.co/t/kafkabeat-help/60724/7 "2016-09-19T14:47:22Z")

</div>

Wild guess: You're using Python 2.6 and the script requires 2.7? Try replacing `{}` with `{0}`.

---

<div class="post-metadata">

**Author:** ![David\_McClain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_mcclain/32/8613_2.png) [@David\_McClain](https://discuss.elastic.co/u/David_McClain)\
**Post date:** [September 19, 2016, 2:49pm UTC](https://discuss.elastic.co/t/kafkabeat-help/60724/8 "2016-09-19T14:49:01Z")

</div>

Wild and accurate. Thanks.

I would almost rather update my python.... That seems like a cleaner solution right?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [September 19, 2016, 2:49pm UTC](https://discuss.elastic.co/t/kafkabeat-help/60724/9 "2016-09-19T14:49:37Z")

</div>

Yes, Python 2.6 is quite old by now.

---

<div class="post-metadata">

**Author:** ![David\_McClain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_mcclain/32/8613_2.png) [@David\_McClain](https://discuss.elastic.co/u/David_McClain)\
**Post date:** [September 19, 2016, 3:59pm UTC](https://discuss.elastic.co/t/kafkabeat-help/60724/10 "2016-09-19T15:59:09Z")

</div>

So, I have python 2.7 installed now alongside python 2.6.  
Done in such as way that it doesn't mess up Centos (since 2.6 is a dependancy for Centos)

How would I go about telling the kafkabeat python files to use the right version?

env python -V is still the 2.6 version.  
I have to go env python2.7 to get 2.7.

---

<div class="post-metadata">

**Author:** ![David\_McClain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_mcclain/32/8613_2.png) [@David\_McClain](https://discuss.elastic.co/u/David_McClain)\
**Post date:** [September 19, 2016, 6:24pm UTC](https://discuss.elastic.co/t/kafkabeat-help/60724/11 "2016-09-19T18:24:02Z")

</div>

Update, I followed these steps:

> **[Install / update to Python 2.7 and latest Pip on EC2 Amazon Linux](http://www.lecloud.net/post/61401763496/install-update-to-python-27-and-latest-pip-on)**
>
> EDIT (May 20, 2015): I brought the article up-to-date and it works again. Thanks for all your comments!
> Unfortunately Amazon Linux 3.4 AMIs still ship with Python 2.6 which makes it impossible to run...

  
To point yum to python2.6 and then created a symlink /usr/bin/python to point to my installation of python2.7.

## So now the make init is working. But make is not.

I'm troubleshooting various errors where a go script isn't finding the right code.

I also had to move the location of the gingerwizard code from:

```auto
$GOPATH/github.com/gingerwizard 

```

to

```auto
$GOPATH/src/github.com/gingerwizard

```

Current errors I'm receiving are:

```auto
vendor/github.com/Shopify/sarama/message.go:10:2: cannot find package "github.com/eapache/go-xerial-snappy" in any of:
        /opt/beats/kafkabeat/go_work/src/github.com/gingerwizard/kafkabeat/vendor/github.com/eapache/go-xerial-snappy (vendor tree)
        /usr/lib/golang/src/github.com/eapache/go-xerial-snappy (from $GOROOT)
        /opt/beats/kafkabeat/go_work/src/github.com/eapache/go-xerial-snappy (from $GOPATH)
vendor/github.com/Shopify/sarama/broker.go:14:2: cannot find package "github.com/rcrowley/go-metrics" in any of:
        /opt/beats/kafkabeat/go_work/src/github.com/gingerwizard/kafkabeat/vendor/github.com/rcrowley/go-metrics (vendor tree)
        /usr/lib/golang/src/github.com/rcrowley/go-metrics (from $GOROOT)
        /opt/beats/kafkabeat/go_work/src/github.com/rcrowley/go-metrics (from $GOPATH)
make: *** [build] Error 1

```

I've found the rcrowley/go-metrics repo:

> **[rcrowley/go-metrics](https://github.com/rcrowley/go-metrics)**
>
> go-metrics - Go port of Coda Hale's Metrics library

~~However, I can't find the eapache/go-xerial-snappy repo. It doesn't seem to exist anymore?~~ Correction, I was only looking at eapache's pinned repos. https://github.com/eapache/go-xerial-snappy is what I was looking for.

---

<div class="post-metadata">

**Author:** ![David\_McClain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_mcclain/32/8613_2.png) [@David\_McClain](https://discuss.elastic.co/u/David_McClain)\
**Post date:** [September 19, 2016, 6:40pm UTC](https://discuss.elastic.co/t/kafkabeat-help/60724/12 "2016-09-19T18:40:03Z")

</div>

Possible success!  
After manually adding in the repos that it was complaining about, and moving the source code from where it originally told me to put it, I was able to get the make to work successfully and build the kafkabeat binary.

@magnusbaeck and @ruflin, do either of you suggest me posting this information as an issue onto the Kafkabeat repo? Or is that technically being phased out with the coming of Metricbeat in 5.0?

Thanks for all your help today.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [September 19, 2016, 7:19pm UTC](https://discuss.elastic.co/t/kafkabeat-help/60724/13 "2016-09-19T19:19:41Z")

</div>

IMHO Kafkabeat's documentation should indicate that glide is a requirement and Beats should list Python 2.7 (for the 2.x series ) or IIRC 3.1 (for the 3.x series) as a dependency and/or bail out with a reasonable error message.

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [September 20, 2016, 7:01am UTC](https://discuss.elastic.co/t/kafkabeat-help/60724/14 "2016-09-20T07:01:00Z")

</div>

Beats already lists the Python 2.7 dependency here: [https://github.com/elastic/beats/blob/master/CONTRIBUTING.md#update-scripts](https://github.com/elastic/beats/blob/master/CONTRIBUTING.md#update-scripts) Most scripts "should" also work on Python 3.x but we all run 2.7 so this is the one really tested.

About Kafkabeat and Metricbeat: We hope to add Kafka module to metricbeat in the near future but this is not the case yet. It is worth opening a PR against Kafkabeat to list this requirement. If you are interested in having Kafka module in Metricbeat, any help is welcome 🙂

---

<div class="post-metadata">

**Author:** ![David\_McClain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_mcclain/32/8613_2.png) [@David\_McClain](https://discuss.elastic.co/u/David_McClain)\
**Post date:** [September 20, 2016, 1:13pm UTC](https://discuss.elastic.co/t/kafkabeat-help/60724/15 "2016-09-20T13:13:10Z")

</div>

Thanks.  
The python version was an oversight for me. However, it was a bit weird trying to compile it on Centos as Centos6.7 requires Python2.6 and you can't upgrade the system version.

The main issues I had where I thought the Kafkabeat documentation was even a little 'off' would be where it depends on some other repos that weren't included and I had to use the error messages to find then and clone them down.  
Maybe I wasn't doing something right, but it was definitely a hurdle.

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [September 20, 2016, 6:12pm UTC](https://discuss.elastic.co/t/kafkabeat-help/60724/16 "2016-09-20T18:12:56Z")

</div>

It is definitively not as easy as it should be. We spent lots of time in the official beats to make it as easy as possible and improved the beat-generator to also make it easier for community beats. Kafkabeat was created quite some time ago (in beats calculation of time) before this existed. For a community beat to catch up on all this is quite hard as it requires lots of efforts. That is also one reason we try to get these beats as modules into metricbeat so the community does not have to do the burden of the maintenance.

Let me know in case you hit similar issues with the official beats.

---

<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:** [October 7, 2016, 2:40pm UTC](https://discuss.elastic.co/t/kafkabeat-help/60724/17 "2016-10-07T14:40:46Z")

</div>

This topic was automatically closed after 21 days. New replies are no longer allowed.
