# Filebeat on Raspberry Pi

**URL:** <https://discuss.elastic.co/t/filebeat-on-raspberry-pi/113697>\
**Category:** Beats\
**Created:** [January 1, 2018, 3:09pm UTC](https://discuss.elastic.co/t/filebeat-on-raspberry-pi/113697 "2018-01-01T15:09:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dm90](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@dm90](https://discuss.elastic.co/u/dm90)\
**Post date:** [January 1, 2018, 3:09pm UTC](https://discuss.elastic.co/t/filebeat-on-raspberry-pi/113697/1 "2018-01-01T15:09:32Z")

</div>

Continuing the discussion from [How to install Filebeat on a ARM based SBC (eg. Raspberry Pi 3)](https://discuss.elastic.co/t/how-to-install-filebeat-on-a-arm-based-sbc-eg-raspberry-pi-3/103670/4):

@andrewkroh Provided easy steps to build an ARM binary for rpi. Consolidated into a shell script for easy execution. Tested on rpi 2 and 3 running stretch.

Here is the script I used:

```
# -------------------------------------------------------------
# Step 1) Build
# NOTE: the git checkout version needs to match the elastic search API version
# -------------------------------------------------------------
elastic_version="6.1.1"

echo "--------------------------------"
echo " $(date)"
echo " Downloading source..."
echo "--------------------------------"
go get github.com/elastic/beats
cd /go/src/github.com/elastic/beats/filebeat/
git checkout "v${elastic_version}"
echo "--------------------------------"
echo " $(date)"
echo " Building source..."
echo "--------------------------------"
GOARCH=arm go build
cp filebeat /build
cd /build

# -------------------------------------------------------------
# Step 2) Download the tar
# The url contains the version number like this: "https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-6.1.1-linux-x86.tar.gz"
# -------------------------------------------------------------

# then download the linux tar from:
download_url="https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-${elastic_version}-linux-x86.tar.gz"
echo "---------------------------------------"
echo " $(date)"
echo " Downloading filebeat tarball from:"
echo " ${download_url}"
echo "---------------------------------------"
curl $download_url -o download.tar 

# -------------------------------------------------------------
# Step 3) Untar, modify, tar
# Drop the filebeat binary into the new tar....
# -------------------------------------------------------------
echo "--------------------------------------------"
echo " $(date)"
echo " Adding the filebeat binary to the tar..."
echo "--------------------------------------------"
mkdir workdir
tar -xf download.tar -C workdir --strip-components=1
cp filebeat workdir/filebeat
cd workdir
tar -zcf ../pibeats-${elastic_version}.tar.gz .
cd ..
echo "--------------------------------"
echo " $(date)"
echo " Clearning up..."
echo "--------------------------------"
rm -rf filebeat
rm -rf workdir
rm -rf download.tar

echo "-------------------------------------------------------------"
echo " $(date)"
echo " COMPLETE! Copy pibeats.tar.gz to raspberry pi!"
echo ""
echo " Something like this?"
echo " scp ./pibeats.tar.gz username@pi_address:/home/username/"
echo "-------------------------------------------------------------"
```

---

<div class="post-metadata">

**Author:** ![dm90](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@dm90](https://discuss.elastic.co/u/dm90)\
**Post date:** [January 5, 2018, 11:55pm UTC](https://discuss.elastic.co/t/filebeat-on-raspberry-pi/113697/2 "2018-01-05T23:55:14Z")

</div>

I ended up configuring filebeat with docker on my Raspberry Pi. I put all the details here: [https://github.com/dam90/pibeats](https://github.com/dam90/pibeats)

I'm happy with the results, and I like seeing the logs in real-time from my pi.

---

<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:** [January 22, 2018, 3:09pm UTC](https://discuss.elastic.co/t/filebeat-on-raspberry-pi/113697/3 "2018-01-22T15:09:42Z")

</div>

This topic was automatically closed after 21 days. New replies are no longer allowed.
