Need advice on creating and collaborating on a new filebeat module

Hello,

I'm administering a rather old application with multiple servers and we're trying to centralise the the application logs. As the vendor doesn't really provide any support for log centralisation I had the grand idea that lets make it a module and share it with the community in case there is someone else out there with the same issue.

My goal is to collaborate with a colleague of mine to create the module locally and once we're happy with the results, create a pull request for the module. In short, I forked (instead of cloning) the beats repo and from that point on, followed the instructions for creating a new module. All was good until I ran into trouble with the make. This is all described more closely on my StackOverflow question on the issue, which sadly has not given me any help.

My questions can be more or less condensed into the following:

  1. Can I collaborate with my geographically separated colleague on the module creation if I clone the beats repo, or is forking it the only way to allow us both pushing out changes to our shared repo?
  2. If I need to fork the repo, is there some instructions on how to overcome the make issues? (details on the SO question, I assume the issue is because of the forking)

Am I doing things completely backwards, am I missing some obvious git pattern, or is this just a really dumb idea?

-Jussi

Hi,

The correct way of setting up your development environment is:

  • Install the required Golang version. (1.11.5 as of the time of writing this). Consider using gvm.

  • Clone the official Beats repo into $GOPATH/src/github.com/elastic/beats

  • Fork the Beats repo into your GitHub account.

  • Set up git remotes:

$ git remote set-url origin git@github.com:<your-github-username>/beats.git
$ git remote add upstream git@github.com:elastic/beats.git
  • Setup PATH and install mage. Inside the beats repo:
cd vendor/github.com/magefile/mage
go install
set PATH=$PATH:$GOPATH/bin

With this you should have a mage binary inside $GOPATH/bin that you can invoke from the terminal because it's in your $PATH.

Aah, so all my trouble was because I first forked the repo and then cloned it, instead of cloning the elastic beats repo, forking it on GitHub and then just changing the origin of the cloned repo and adding the elastic repo as upstream.

So far it looks better, I didn't get any errors yet. Thank you so much for the help :slight_smile:

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