# Creat git submodules for the various beats

**URL:** <https://discuss.elastic.co/t/creat-git-submodules-for-the-various-beats/128769>\
**Category:** Beats\
**Created:** [April 19, 2018, 8:50pm UTC](https://discuss.elastic.co/t/creat-git-submodules-for-the-various-beats/128769 "2018-04-19T20:50:48Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![amomchilov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amomchilov/32/30271_2.png) [@amomchilov](https://discuss.elastic.co/u/amomchilov)\
**Post date:** [April 19, 2018, 8:50pm UTC](https://discuss.elastic.co/t/creat-git-submodules-for-the-various-beats/128769/1 "2018-04-19T20:50:48Z")

</div>

I wish to import Filebeat into an in-house package manager, but I don't want to pull in all the beats. Would it be possible to isolate each beat into its own git sub-module, all under the umbrella of the beat repository?

---

<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:** [April 20, 2018, 6:29am UTC](https://discuss.elastic.co/t/creat-git-submodules-for-the-various-beats/128769/2 "2018-04-20T06:29:48Z")

</div>

We are pretty happy with the current setup so this is unlikely to change. We had in the past one repo per Beat which didn't work as well for us.

Perhaps you can share some more details on what you exactly do so we can help finding an other solution?

---

<div class="post-metadata">

**Author:** ![amomchilov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amomchilov/32/30271_2.png) [@amomchilov](https://discuss.elastic.co/u/amomchilov)\
**Post date:** [April 20, 2018, 6:50am UTC](https://discuss.elastic.co/t/creat-git-submodules-for-the-various-beats/128769/3 "2018-04-20T06:50:22Z")

</div>

Hey, thanks for getting back so soon! Yeah, I can see the benefit of having them in one repo. `libbeat` is already just "there', make things easy.

I work at a large tech company with no standardized language/tech stack, for which purpose they developed an internal platform/language agnostic package manager, build system and continuous deployment system. It allows you to pull in third party packages from Git, but that forces me to to pull in the whole beats repo, rather than just Filebeat (the only beat I care about). This wouldn't necessarily be an issue, but some of the other beats (or their dependancies) have licenses that aren't compatible with our use.

The best I could think of was to make my own fork of the beats repo, and use `git filter-branch`. But this adds extra steps to the version upgrading process which makes it less likely people will be upgrading this internal package often.

Let me know if you have any ideas 🙂

---

<div class="post-metadata">

**Author:** ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)\
**Post date:** [April 20, 2018, 12:00pm UTC](https://discuss.elastic.co/t/creat-git-submodules-for-the-various-beats/128769/4 "2018-04-20T12:00:41Z")

</div>

Do you just use `libbeat`?

---

<div class="post-metadata">

**Author:** ![amomchilov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amomchilov/32/30271_2.png) [@amomchilov](https://discuss.elastic.co/u/amomchilov)\
**Post date:** [April 20, 2018, 2:39pm UTC](https://discuss.elastic.co/t/creat-git-submodules-for-the-various-beats/128769/5 "2018-04-20T14:39:46Z")

</div>

I believe so. So far I only got `libbeat` and `filebeat` directories. I haven't gotten it to build yet, for unrelated reasons, so I'm not yet sure which other dirs I need for a successful build.

But since `fielbeat`/`libbeat` aren't submodules, importing them on their own is quite a laborious process.

---

<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:** [April 23, 2018, 8:53am UTC](https://discuss.elastic.co/t/creat-git-submodules-for-the-various-beats/128769/6 "2018-04-23T08:53:25Z")

</div>

What about cloning the repo but have a follow up command that deletes all the other beats directories and runs `make update` again?

Which license are a problem for you? We recently cleaned up the licenses a bit.

---

<div class="post-metadata">

**Author:** ![amomchilov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amomchilov/32/30271_2.png) [@amomchilov](https://discuss.elastic.co/u/amomchilov)\
**Post date:** [April 24, 2018, 4:06pm UTC](https://discuss.elastic.co/t/creat-git-submodules-for-the-various-beats/128769/7 "2018-04-24T16:06:53Z")

</div>

Yeah, that's pretty much what I came up with.

> Some parts of this are not usable due to prohibited licenses, but filebeat should fine to use.  
> Can filebeat be used without the following parts?
> 
> 1. vendor/github.com/juju/ratelimit
> 2. vendor/github.com/gorhill/cronexpr
> 3. metricbeat/module/mysql/vendor/github.com/go-sql-driver
> 4. metricbeat/module/docker/vendor/github.com/hashicorp/go-cleanhttp

Seems like #1, #4 aren't dependancies anymore, #3 is fine because it uses the Mozilla license, but [`cronexpr`](https://github.com/elastic/beats/tree/master/vendor/github.com/gorhill/cronexpr) is an issue because it (somehow) has both [APLv2](https://github.com/elastic/beats/blob/master/vendor/github.com/gorhill/cronexpr/APLv2) and [GPLv3](https://github.com/elastic/beats/blob/master/vendor/github.com/gorhill/cronexpr/GPLv3) licenses. APLv2 is fine, but GPL is prohibited for our use =/.

---

<div class="post-metadata">

**Author:** ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)\
**Post date:** [April 25, 2018, 11:02am UTC](https://discuss.elastic.co/t/creat-git-submodules-for-the-various-beats/128769/8 "2018-04-25T11:02:01Z")

</div>

Running `govendor list` ([https://github.com/kardianos/govendor](https://github.com/kardianos/govendor)), you can see all dependencies and a status of vendored dependencies. After deleting the other beats, the status `unused` (short `u`) indicates a vendored dependencies not required anymore. You can delete unsued dependencies using `govender remove`.

---

<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:** [May 23, 2018, 1:02pm UTC](https://discuss.elastic.co/t/creat-git-submodules-for-the-various-beats/128769/9 "2018-05-23T13:02:16Z")

</div>

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