# Building filebeat with journald support for arm

**URL:** <https://discuss.elastic.co/t/building-filebeat-with-journald-support-for-arm/307490>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [June 17, 2022, 9:25am UTC](https://discuss.elastic.co/t/building-filebeat-with-journald-support-for-arm/307490 "2022-06-17T09:25:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marko\_Todoric](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marko_todoric/32/52975_2.png) [@Marko\_Todoric](https://discuss.elastic.co/u/Marko_Todoric)\
**Post date:** [June 17, 2022, 9:25am UTC](https://discuss.elastic.co/t/building-filebeat-with-journald-support-for-arm/307490/1 "2022-06-17T09:25:27Z")

</div>

Hello everyone,

I've been struggling to figure out how to compile filebeat with support for journald for arm platform.  
I know it seems to not be officially supported (since there are no arm packages available to download officially) but it does seem to work when i compile it.

I've been following this guide -\> [Contributing to Beats | Beats Developer Guide [master] | Elastic](https://www.elastic.co/guide/en/beats/devguide/current/beats-contributing.html) to build however I was running into few problems:

I'm building this on arm64 ec2 instance since it's a lot faster then actually building on raspberry pi.  
I'm trying to compile it for arm (not arm64). When running:

```auto
mage build

```

As described in contributing documentation, it builds for arm64, ofcourse - as expected.

When trying to build it with

```auto
GOOS=linux GOARCH=arm CGO_ENABLED=1 mage build
<or>
GOOS=linux GOARCH=arm mage build

```

It fails build with `gcc: error: unrecognized command line option '-marm'`

When building with go build using:

```auto
GOOS=linux GOARCH=arm go build

```

It manages to compile it successfully and filestream input works, but when i try to use journald input it says `No such input type exist: 'journald'`.  
I tried crossBuild with mage - it builds only for arm64 doesn't even try arm.

Eventually i tried to compile with go build -x (which is verbose output) to try to get some errors possibly but cannot see anything error related to journald and does try to compile it.

I would really appreciate some help on this

---

<div class="post-metadata">

**Author:** ![TiagoQueiroz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tiagoqueiroz/32/107061_2.png) [@TiagoQueiroz](https://discuss.elastic.co/u/TiagoQueiroz)\
**Post date:** [June 17, 2022, 11:14am UTC](https://discuss.elastic.co/t/building-filebeat-with-journald-support-for-arm/307490/2 "2022-06-17T11:14:11Z")

</div>

Hi @Marko_Todoric,

The journald input is behind a [build tag](https://pkg.go.dev/cmd/go#hdr-Build_constraints) because it required CGO and only works on Linux.

To build it, you need to add `-tags=linux,cgo,withjournald` to your `go build` command.

You will also need to have some journald packages installed on your build machine.

---

<div class="post-metadata">

**Author:** ![Marko\_Todoric](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marko_todoric/32/52975_2.png) [@Marko\_Todoric](https://discuss.elastic.co/u/Marko_Todoric)\
**Post date:** [June 17, 2022, 11:24am UTC](https://discuss.elastic.co/t/building-filebeat-with-journald-support-for-arm/307490/3 "2022-06-17T11:24:41Z")

</div>

I was building on linux and actually tried with `-tags=withjournald` (however without linux and cgo since it was already in env var) and also didn't work.

What eventually managed to get it to work was to use crossBuild target for mage but with specifying linux/armv7 in PLATFORMS variable, however on a x64 vm, not arm64.

Specifically

```auto
PLATFORMS="linux/armv7" mage crossBuild

```

Now it managed to compile with journald input and i obtained arm executable, now i have a different problem but that's for another thread 😃 thanks for quick reply!

---

<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 15, 2022, 1:24pm UTC](https://discuss.elastic.co/t/building-filebeat-with-journald-support-for-arm/307490/4 "2022-07-15T13:24:46Z")

</div>

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