Content Table

cm-toc v.0.4 By 코마

How to build filebeat on windows 10

Let's dance with golang

22 Jun 2019 by 코마

Hello again, This is CoMa (Code-Machina). Today, I introduce How to build filebeat on windows 10. This is quite easy, and quick. Just Follow me. 😺

What is A filebeat?

Filebeat is a log shippper maintained by elastic group. You can download it freely from github.com/elastic/beats. Why should you build it?

Because it will let you give yourself a ability to make a own your *beat. Now let’s get to the point.

Goal

Pre-requisite

Step1. Install Mage

Install Mage. Just follow the below code snippets.

>go get -u -d github.com/magefile/mage
cd %GOPATH%/src/github.com/magefile/mage
go run bootstrap.go

step2. Install tdm-gcc-x64

Follow the below link, and then install it on your windows 10.

step3. Clonning beats Repo

Clone beats repo using git

>REM Windows Commands
mkdir %GOPATH%/src/github.com/elastic
git clone https://github.com/elastic/beats %GOPATH%/src/github.com/elastic/beats

step4. Set Windows Environment Variables

Maybe you tried to install serveral gcc packages from other sources. But only when you build your code, you need tdm-gcc compiler. So, just change an order of %PATH%.

>set PATH=C:\TDM-GCC-64\bin\;%PATH%
where gcc
C:\TDM-GCC-64\bin\gcc.exe
....
(생략)

step5. Build filebeat

Finally, You can build filebeat.

>REM filebeat 경로로 이동
cd %gopath%\src\github.com\elastic\beats\filebeat
REM filebeat 빌드
make.bat build
REM filebeat 실행 파일 생성 체크
dir filebeat.exe

Refs.

이 작가의 다음 글 감상