# Filebeat compile on OpenBSD 6.0

**URL:** <https://discuss.elastic.co/t/filebeat-compile-on-openbsd-6-0/65145>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [November 6, 2016, 6:11pm UTC](https://discuss.elastic.co/t/filebeat-compile-on-openbsd-6-0/65145 "2016-11-06T18:11:47Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gordo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gordo/32/13004_2.png) [@Gordo](https://discuss.elastic.co/u/Gordo)\
**Post date:** [November 6, 2016, 6:11pm UTC](https://discuss.elastic.co/t/filebeat-compile-on-openbsd-6-0/65145/1 "2016-11-06T18:11:47Z")

</div>

I would like to run Filebeat 5.0 on an OpenBSD 6.0 server.

The current version of Go on OpenBSD is 1.6 and it would appear that there is a dependency on the Go 1.7 (specifically, a failing context import error, related to moving context into the Go 'core').

Is there a way to compile with Go 1.6?

Thanks!

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [November 7, 2016, 1:13am UTC](https://discuss.elastic.co/t/filebeat-compile-on-openbsd-6-0/65145/2 "2016-11-07T01:13:52Z")

</div>

You can install Go 1.7 by [building it from source](https://golang.org/doc/install/source). Then use that to build Beats.

---

<div class="post-metadata">

**Author:** ![Gordo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gordo/32/13004_2.png) [@Gordo](https://discuss.elastic.co/u/Gordo)\
**Post date:** [November 7, 2016, 1:40am UTC](https://discuss.elastic.co/t/filebeat-compile-on-openbsd-6-0/65145/3 "2016-11-07T01:40:09Z")

</div>

Thanks Andrew, I actually have built Go 1.7.

But currently Go 1.7 is only available on head (as opposed to stable or current), I typically prefer to track stable, as there are fewer surprises.

Thus my question about 1.6.

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [November 7, 2016, 1:57am UTC](https://discuss.elastic.co/t/filebeat-compile-on-openbsd-6-0/65145/4 "2016-11-07T01:57:17Z")

</div>

> [@Gordo](#):
>
> Is there a way to compile with Go 1.6?

You would have to patch it. Probably it's just the add\_cloud\_metadata processor that's causing you an issue. You could just remove that file if you aren't using that processor type.

---

<div class="post-metadata">

**Author:** ![Gordo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gordo/32/13004_2.png) [@Gordo](https://discuss.elastic.co/u/Gordo)\
**Post date:** [November 8, 2016, 1:56am UTC](https://discuss.elastic.co/t/filebeat-compile-on-openbsd-6-0/65145/5 "2016-11-08T01:56:58Z")

</div>

**This is just for reference for anyone who wants to build filebeat 5.0 for OpenBSD 6.0**

- NOTE: To build, /usr/ will have to have more disk space then normal 'default' partition. Consider deleting all the partitions except swap and add all back on one '/'

- Fetching the ports tree:

```auto
cd /tmp
ftp https://ftp.openbsd.org/pub/OpenBSD/6.0/ports.tar.gz
ftp https://ftp.openbsd.org/pub/OpenBSD/6.0/SHA256.sig

```

- Validate:

```auto
signify -Cp /etc/signify/openbsd-$(uname -r | cut -c 1,3)-base.pub -x SHA256.sig ports.tar.gz

```

```auto
Signature Verified
ports.tar.gz: OK

```

- Consider using screen to run builds that take a long time:

```auto
export PKG_PATH="http://ftp.openbsd.org/pub/OpenBSD/6.0/packages/amd64/"
sudo pkg_add screen
screen

```

- Untar:

```auto
cd /usr
sudo tar xzf /tmp/ports.tar.gz

```

- Update from cvs, tracking HEAD:

```auto
cd /usr
sudo cvs -d anoncvs@anoncvs.ca.openbsd.org:/cvs get -rHEAD -P ports

```

- Build go:

```auto
cd /usr/ports/lang/go
sudo make install

```

- Files are available in:

```auto
ls /usr/ports/packages/amd64/all                                                                                                                                                       

```

```auto
bash-4.3.48.tgz
gettext-0.19.8.1.tgz
go-1.7p0.tgz
go-bootstrap-1.4.3p2.tgz
libiconv-1.14p3.tgz
xz-5.2.2p0.tgz

```

- Install dependencies to build filebeat:

```auto
export PKG_PATH="http://mirror/pub/OpenBSD/6.0/packages/amd64/"
sudo pkg_add git gmake

```

- Then regular checkout and build of filebeat:

```auto
mkdir ~/go
export GOPATH=~/go
mkdir -p $GOPATH/src/github.com/elastic
cd $GOPATH/src/github.com/elastic
git clone https://github.com/elastic/beats.git

```

- List and switch to the appropriate branch, release 5.0:

```auto
cd beats
git branch -a
git checkout -b remotes/origin/5.0
git branch -a

```

```auto
git fetch
git checkout 5.0

```

- Build:

```auto
cd filebeat
go get
gmake

```

_Edit to add pkg\_add of git and gmake_

---

<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:** [November 8, 2016, 7:30am UTC](https://discuss.elastic.co/t/filebeat-compile-on-openbsd-6-0/65145/6 "2016-11-08T07:30:57Z")

</div>

@Gordo Thanks a lot for sharing all these details with the community 👍

---

<div class="post-metadata">

**Author:** ![Gordo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gordo/32/13004_2.png) [@Gordo](https://discuss.elastic.co/u/Gordo)\
**Post date:** [November 8, 2016, 1:06pm UTC](https://discuss.elastic.co/t/filebeat-compile-on-openbsd-6-0/65145/7 "2016-11-08T13:06:33Z")

</div>

NP, just a past of my install notes.

---

<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:** [December 6, 2016, 1:06pm UTC](https://discuss.elastic.co/t/filebeat-compile-on-openbsd-6-0/65145/8 "2016-12-06T13:06:48Z")

</div>

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