# Compiling Filebeat difficulties (Resolved)

**URL:** <https://discuss.elastic.co/t/compiling-filebeat-difficulties-resolved/38684>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [January 8, 2016, 12:47am UTC](https://discuss.elastic.co/t/compiling-filebeat-difficulties-resolved/38684 "2016-01-08T00:47:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![arahael](https://avatars.discourse-cdn.com/v4/letter/a/ee59a6/32.png) [@arahael](https://discuss.elastic.co/u/arahael)\
**Post date:** [January 8, 2016, 12:47am UTC](https://discuss.elastic.co/t/compiling-filebeat-difficulties-resolved/38684/1 "2016-01-08T00:47:37Z")

</div>

I need to have multiline support, which seems to be implemented in master and backported to the 1.1 branch, however is not yet released.

I was hoping to be able to compile this on mac os x, but I can't seem to find any instructions to do so!

Specifically, cloning the git repository and then doing a `GOPATH=~/go make` does not appear to work, with the following issue:

```
docker-compose build
/bin/bash: docker-compose: command not found

```

So, it seems that the build process requires docker (which is not mentioned anywhere?)

My system runs VMware, is there any way I can avoid having to use docker as I do not want to install two different hypervisors simultaniously? (It is not recommended to use VirtualBox and VMware simultaniously, and docker does not automatically work with VMware).

I will probably have to use log-courier instead, however I am hoping to resolve this so that I can consider creating my own 'beat' package in the near future.

---

<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:** [January 8, 2016, 7:24am UTC](https://discuss.elastic.co/t/compiling-filebeat-difficulties-resolved/38684/2 "2016-01-08T07:24:58Z")

</div>

Did you clone [https://github.com/elastic/beats](https://github.com/elastic/beats) and run make from the filebeat directory? What if you run `make build` instead of plain `make`? Docker should only be required for running integration tests.

Docker isn't a hypervisor and I haven't heard anything about it not working in VMware guests.

---

<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 8, 2016, 8:10am UTC](https://discuss.elastic.co/t/compiling-filebeat-difficulties-resolved/38684/3 "2016-01-08T08:10:05Z")

</div>

I think @magnusbaeck is right and you are probably running make inside the beats folder instead of filebeat. Instead of compiling it yourself you can also download the nightly build for 1.1 here: [https://beats-nightlies.s3.amazonaws.com/index.html?prefix=filebeat/](https://beats-nightlies.s3.amazonaws.com/index.html?prefix=filebeat/)

---

<div class="post-metadata">

**Author:** ![arahael](https://avatars.discourse-cdn.com/v4/letter/a/ee59a6/32.png) [@arahael](https://discuss.elastic.co/u/arahael)\
**Post date:** [January 11, 2016, 4:55am UTC](https://discuss.elastic.co/t/compiling-filebeat-difficulties-resolved/38684/4 "2016-01-11T04:55:34Z")

</div>

Hello Magnusbaeck, Thanks for the quick response;

Yes, I did clone the repository:

```
$ git remote -v show
origin https://github.com/elastic/beats.git (fetch)
origin https://github.com/elastic/beats.git (push)

```

Running 'make' from the filebeat directory instead of the root directory of the repository doesn't work either:

```
$ pwd && GOPATH=~/go make build
/Users/arahael/dev/logstash_investigation/beats/filebeat
go build
main.go:4:2: cannot find package "github.com/elastic/beats/filebeat/beat" in any of:
    /usr/local/Cellar/go/1.5.2/libexec/src/github.com/elastic/beats/filebeat/beat (from $GOROOT)
    /Users/arahael/go/src/github.com/elastic/beats/filebeat/beat (from $GOPATH)
main.go:5:2: cannot find package "github.com/elastic/beats/libbeat/beat" in any of:
    /usr/local/Cellar/go/1.5.2/libexec/src/github.com/elastic/beats/libbeat/beat (from $GOROOT)
    /Users/arahael/go/src/github.com/elastic/beats/libbeat/beat (from $GOPATH)
make: *** [build] Error 1

```

Performing 'make build' in the repository root also doesn't work, because there is no rule for it, however there is a default rule but that has the issue with needing docker, as previously explained.

I would prefer to run my own build, so that I can be confident that developing my own "beat" is feasible.

---

<div class="post-metadata">

**Author:** ![arahael](https://avatars.discourse-cdn.com/v4/letter/a/ee59a6/32.png) [@arahael](https://discuss.elastic.co/u/arahael)\
**Post date:** [January 11, 2016, 5:00am UTC](https://discuss.elastic.co/t/compiling-filebeat-difficulties-resolved/38684/5 "2016-01-11T05:00:18Z")

</div>

Hello Magnusbaeck,

In addition, regarding the docker point, I wasn't referring to using it as a hypervisor.

As docker requires a few features found in Linux to operate, other operating systems require a virtual machine, and docker generally works with VIrtualBox for this reason. In this case, I am doing all the commands on the host system, which is Mac OS X.

On this host system, I have installed VMware, and use it for various unrelated tasks, however, docker does not support VMware (without commercial add-on packages). As a result, it will tend to use VIrtualBox instead.

I have no wish to install VirtualBox, and so can not use Docker on this machine (as docker does not natively support Mac OS X without using a virtual machine)

---

<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:** [January 11, 2016, 7:15am UTC](https://discuss.elastic.co/t/compiling-filebeat-difficulties-resolved/38684/6 "2016-01-11T07:15:43Z")

</div>

You have the Filebeat source directory (~/dev/logstash\_investigation/beats/filebeat) outside of GOPATH (~/go) and I'm not sure that's a good idea. At the very least I'd expect that you'll have to run `go get` to download the missing packages, but even if that works you'd end up with two copies of the beats git.

While I haven't fully grasped GOPATH, the suggested source code organization, and when `go get` is run automatically, this should definitely work:

```auto
cd ~/go
export GOPATH=$(pwd)
go get github.com/elastic/beats
cd src/github.com/elastic/beats/filebeat
go get
make

```

---

<div class="post-metadata">

**Author:** ![arahael](https://avatars.discourse-cdn.com/v4/letter/a/ee59a6/32.png) [@arahael](https://discuss.elastic.co/u/arahael)\
**Post date:** [January 12, 2016, 12:31am UTC](https://discuss.elastic.co/t/compiling-filebeat-difficulties-resolved/38684/7 "2016-01-12T00:31:35Z")

</div>

Hello Magnusbaeck,

That does definitely work, thanks!

I now have:

```
$ ./filebeat --version
filebeat version 1.2.0-SNAPSHOT (amd64)

```

So this is a success.

---

<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:56pm UTC](https://discuss.elastic.co/t/compiling-filebeat-difficulties-resolved/38684/8 "2017-07-05T21:56:50Z")

</div>


