Filebeat compile on OpenBSD 6.0


(Gordo) #1

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!


(Andrew Kroh) #2

You can install Go 1.7 by building it from source. Then use that to build Beats.


(Gordo) #3

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.


(Andrew Kroh) #4

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.


HowTo - Filebeat on OpenBSD 5.9
(Gordo) #5

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:

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:
signify -Cp /etc/signify/openbsd-$(uname -r | cut -c 1,3)-base.pub -x SHA256.sig ports.tar.gz
Signature Verified
ports.tar.gz: OK
  • Consider using screen to run builds that take a long time:
export PKG_PATH="http://ftp.openbsd.org/pub/OpenBSD/6.0/packages/amd64/"
sudo pkg_add screen
screen
  • Untar:
cd /usr
sudo tar xzf /tmp/ports.tar.gz
  • Update from cvs, tracking HEAD:
cd /usr
sudo cvs -d anoncvs@anoncvs.ca.openbsd.org:/cvs get -rHEAD -P ports
  • Build go:
cd /usr/ports/lang/go
sudo make install
  • Files are available in:
ls /usr/ports/packages/amd64/all                                                                                                                                                       
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:
export PKG_PATH="http://mirror/pub/OpenBSD/6.0/packages/amd64/"
sudo pkg_add git gmake
  • Then regular checkout and build of filebeat:
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:
cd beats
git branch -a
git checkout -b remotes/origin/5.0
git branch -a
git fetch
git checkout 5.0
  • Build:
cd filebeat
go get
gmake

Edit to add pkg_add of git and gmake


(ruflin) #6

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


(Gordo) #7

NP, just a past of my install notes.


(system) #8

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