# Distributing custom beats?

**URL:** <https://discuss.elastic.co/t/distributing-custom-beats/114313>\
**Category:** Beats\
**Tags:** beats-development\
**Created:** [January 5, 2018, 5:12pm UTC](https://discuss.elastic.co/t/distributing-custom-beats/114313 "2018-01-05T17:12:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grigory\_Shamov1](https://avatars.discourse-cdn.com/v4/letter/g/96bed5/32.png) [@Grigory\_Shamov1](https://discuss.elastic.co/u/Grigory_Shamov1)\
**Post date:** [January 5, 2018, 5:12pm UTC](https://discuss.elastic.co/t/distributing-custom-beats/114313/1 "2018-01-05T17:12:15Z")

</div>

Hi All,

Is there a best practice on how to distribute custom beats Sources, including the right Golang dependencies?

Right now, it is kind of hard, because of Beats library having complex build mechanism. It gives a nice bolerplate; So you have your code under ./config and ./beater, and it all just works.

Then trying to ./vendor elastic/beats does not just work; on Github there is quite a few custom beats, they all have some "instructions" (first clone the beat, then clone elastic/beats of the righ version, then copy it somewhere, and then it all fails to import some dependency or another). And looks like copying the entire thing gives you Metricbeat, FIlebeat, and what not.

Is there a way to vendor just the necessary dependencies and still have an automatic build? Any tools that people use? I have tried just running the Google 'dep' tool on my custom beat tree, but it fails to create correct ./vendor somehow.

Thank you very much in advance!

--  
Grigory Shamov  
University of Manitoba / Westgrid

---

<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:** [January 9, 2018, 1:06am UTC](https://discuss.elastic.co/t/distributing-custom-beats/114313/2 "2018-01-09T01:06:07Z")

</div>

One thing I wrote for `apm-server` which depends on libbeat can be found here: [https://github.com/elastic/apm-server/tree/master/\_beats](https://github.com/elastic/apm-server/tree/master/_beats) It does some tricks around removing the unnecessary files and still making sure everything works. We should probably get this code into the beats generator so every new beat created can make use of these scripts and approve upon.

It would be great if you could try out these scripts on your end to let us know if they work for you or need further generalisation.

---

<div class="post-metadata">

**Author:** ![Grigory\_Shamov1](https://avatars.discourse-cdn.com/v4/letter/g/96bed5/32.png) [@Grigory\_Shamov1](https://discuss.elastic.co/u/Grigory_Shamov1)\
**Post date:** [January 9, 2018, 4:02pm UTC](https://discuss.elastic.co/t/distributing-custom-beats/114313/3 "2018-01-09T16:02:00Z")

</div>

Hi Ruflin,

Thanks a lot! will try now!

Grigory Shamov

---

<div class="post-metadata">

**Author:** ![cyrilleverrier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cyrilleverrier/32/9926_2.png) [@cyrilleverrier](https://discuss.elastic.co/u/cyrilleverrier)\
**Post date:** [January 18, 2018, 12:59pm UTC](https://discuss.elastic.co/t/distributing-custom-beats/114313/4 "2018-01-18T12:59:57Z")

</div>

@ruflin: I tried the script but it doesn't work out of the box. I made some modifications to the original setup but I would appreciate some help before submitting PR back to Elastic.

see [Create new beat based on libbeat 6.1?](https://discuss.elastic.co/t/create-new-beat-based-on-libbeat-6-1/116051)

---

<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:** [February 15, 2018, 12:59pm UTC](https://discuss.elastic.co/t/distributing-custom-beats/114313/5 "2018-02-15T12:59:59Z")

</div>

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