Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save lvaylet/68b98f9723196ac324d93ff65f86580b to your computer and use it in GitHub Desktop.

Select an option

Save lvaylet/68b98f9723196ac324d93ff65f86580b to your computer and use it in GitHub Desktop.

Revisions

  1. lvaylet revised this gist Apr 18, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion cross-compile_filebeat_arm.md
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,7 @@ GOARCH=arm go build
    cp filebeat /build
    exit

    # ----- Verify the outputfile ----- #
    # ----- Verify the output file ----- #
    file filebeat
    #filebeat: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, not stripped
    ```
  2. lvaylet renamed this gist Mar 8, 2018. 1 changed file with 10 additions and 6 deletions.
    16 changes: 10 additions & 6 deletions cross-compile_filebeat_arm.sh → cross-compile_filebeat_arm.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    # Elastic does not provide Filebeat binaries for ARMv7. Luckily, Filebeat can easily be cross-compiled with:
    Elastic does not provide Filebeat binaries for ARMv7. Luckily, Filebeat can easily be cross-compiled with:

    ```bash
    # ----- Instantiate an immutable Go container for cross-compilation ----- #
    mkdir build && cd $_
    docker run -it --rm -v `pwd`:/build golang:1.9 /bin/bash
    @@ -15,9 +16,12 @@ exit
    # ----- Verify the outputfile ----- #
    file filebeat
    #filebeat: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, not stripped
    ```

    # Then the newly built Filebeat binary can be uploaded to the remote PCM3 (for example with http://transfer.sh).
    # On the PCM3, download the official 32-bit Linux archive from https://www.elastic.co/downloads/beats/filebeat. Extract the archive and replace the Filebeat binary with the one you cross-compiled and uploaded.
    # Install Filebeat by following the Mac instructions at https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-installation.html
    # Configure Filebeat as described in the **Using Filebeat** section at https://logz.io/blog/docker-logging/
    # Run Filebeat and confirm your logs show up in Kibana at `elk_stack_ip:5601` with a `filebeat-*` index pattern.
    The newly built Filebeat binary can then be uploaded to the remote PCM3, for example with http://transfer.sh

    On the PCM3:
    - Download the official 32-bit Linux archive from https://www.elastic.co/downloads/beats/filebeat. Extract the archive and replace the Filebeat binary with the one you cross-compiled and uploaded.
    - Install Filebeat by following the Mac instructions at https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-installation.html
    - Configure Filebeat as described in the **Using Filebeat** section at https://logz.io/blog/docker-logging/
    - Run Filebeat and confirm your logs show up in Kibana at `elk_stack_ip:5601` with a `filebeat-*` index pattern.
  3. lvaylet revised this gist Mar 8, 2018. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions cross-compile_filebeat_arm.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    # Elastic does not provide Filebeat binaries for ARMv7. Luckily, Filebeat can easily be cross-compiled with:

    # ----- Instantiate an immutable Go container for cross-compilation ----- #
    mkdir build && cd $_
    docker run -it --rm -v `pwd`:/build golang:1.9 /bin/bash
    @@ -13,3 +15,9 @@ exit
    # ----- Verify the outputfile ----- #
    file filebeat
    #filebeat: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, not stripped

    # Then the newly built Filebeat binary can be uploaded to the remote PCM3 (for example with http://transfer.sh).
    # On the PCM3, download the official 32-bit Linux archive from https://www.elastic.co/downloads/beats/filebeat. Extract the archive and replace the Filebeat binary with the one you cross-compiled and uploaded.
    # Install Filebeat by following the Mac instructions at https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-installation.html
    # Configure Filebeat as described in the **Using Filebeat** section at https://logz.io/blog/docker-logging/
    # Run Filebeat and confirm your logs show up in Kibana at `elk_stack_ip:5601` with a `filebeat-*` index pattern.
  4. lvaylet revised this gist Mar 6, 2018. 1 changed file with 10 additions and 8 deletions.
    18 changes: 10 additions & 8 deletions cross-compile_filebeat_arm.sh
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,15 @@
    #----- Create a Docker for cross-compilation -----#
    # ----- Instantiate an immutable Go container for cross-compilation ----- #
    mkdir build && cd $_
    docker run -it --rm -v `pwd`:/build golang:1.8.3 /bin/bash
    #----- Inside docker -----#
    go get github.com/elastic/beats
    docker run -it --rm -v `pwd`:/build golang:1.9 /bin/bash

    # ----- Inside Go container ----- #
    go get github.com/elastic/beats
    cd /go/src/github.com/elastic/beats/filebeat/
    git checkout v5.6.3
    git checkout v6.2.2
    GOARCH=arm go build
    cp filebeat /build
    exit
    #----- Verify the outputfile -----#
    file filebeat
    #filebeat: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, not stripped

    # ----- Verify the outputfile ----- #
    file filebeat
    #filebeat: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, not stripped
  5. @anis-campos anis-campos revised this gist Oct 21, 2017. No changes.
  6. @anis-campos anis-campos revised this gist Oct 21, 2017. No changes.
  7. @anis-campos anis-campos created this gist Oct 21, 2017.
    13 changes: 13 additions & 0 deletions cross-compile_filebeat_arm.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    #----- Create a Docker for cross-compilation -----#
    mkdir build && cd $_
    docker run -it --rm -v `pwd`:/build golang:1.8.3 /bin/bash
    #----- Inside docker -----#
    go get github.com/elastic/beats
    cd /go/src/github.com/elastic/beats/filebeat/
    git checkout v5.6.3
    GOARCH=arm go build
    cp filebeat /build
    exit
    #----- Verify the outputfile -----#
    file filebeat
    #filebeat: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, not stripped