# How to create a new Beats output?

**URL:** <https://discuss.elastic.co/t/how-to-create-a-new-beats-output/61074>\
**Category:** Beats\
**Created:** [September 21, 2016, 4:06am UTC](https://discuss.elastic.co/t/how-to-create-a-new-beats-output/61074 "2016-09-21T04:06:59Z")\
**Posts on this page:** 1\
**Showing post:** 9

<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:** [September 29, 2016, 9:35am UTC](https://discuss.elastic.co/t/how-to-create-a-new-beats-output/61074/9 "2016-09-29T09:35:31Z")

</div>

There is no need to clone or copy filebeat. See my post from 7 days ago.

You might have 2 repositories for example:

1. `github.com/ageetha/logmet` holding the new output plugin
2. `github.com/ageetha/filebeat-logmet` holding your custom filebeat with logmet being included.

In `github.com/ageetha/filebeat-logmet` you have only one file named `main.go` with content:

```auto
import (
    "os"

    _ "github.com/ageetha/logmet"

    "github.com/elastic/beats/filebeat/beater"
    "github.com/elastic/beats/libbeat/beat"
)

Name := "filebeat-logmet"

func main() {
    if err := beat.Run(Name, "", beater.New()); err != nil {
        os.Exit(1)
    }
}

```

No run `go build` in `$GOPATH/src/github.com/ageetha/filebeat-logmet` directory and you will get your filebeat binary. Advantage of this solution is, you can more easily upgrade to new filebeat just by checking another branch from filebeat. Updating to filebeat 5.0 will require you to change main.go to:

```auto
import (
    "os"

        _ "github.com/myuser/mybeatsoutputs/myoutput"

    "github.com/elastic/beats/filebeat/beater"
    "github.com/elastic/beats/libbeat/beat"
)

func main() {
    if err := beat.Run("myfilebeat, "", beater.New); err != nil {
        os.Exit(1)
    }
}

```

Beats are made this way, to reduce the amount of maintenance normally required when copying and modifying some other projects source code.

---

_[View the full topic](https://discuss.elastic.co/t/how-to-create-a-new-beats-output/61074)._
