Windows
Fluent Bit is distributed as fluent-bit package for Windows. Fluent Bit has two flavours of Windows installers: a ZIP archive (for quick testing) and an EXE installer (for system installation).

Configuration

Make sure to provide a valid Windows configuration with the installation, a sample one is shown below:
1
[SERVICE]
2
# Flush
3
# =====
4
# set an interval of seconds before to flush records to a destination
5
flush 5
6
7
# Daemon
8
# ======
9
# instruct Fluent Bit to run in foreground or background mode.
10
daemon Off
11
12
# Log_Level
13
# =========
14
# Set the verbosity level of the service, values can be:
15
#
16
# - error
17
# - warning
18
# - info
19
# - debug
20
# - trace
21
#
22
# by default 'info' is set, that means it includes 'error' and 'warning'.
23
log_level info
24
25
# Parsers File
26
# ============
27
# specify an optional 'Parsers' configuration file
28
parsers_file parsers.conf
29
30
# Plugins File
31
# ============
32
# specify an optional 'Plugins' configuration file to load external plugins.
33
plugins_file plugins.conf
34
35
# HTTP Server
36
# ===========
37
# Enable/Disable the built-in HTTP Server for metrics
38
http_server Off
39
http_listen 0.0.0.0
40
http_port 2020
41
42
# Storage
43
# =======
44
# Fluent Bit can use memory and filesystem buffering based mechanisms
45
#
46
# - https://docs.fluentbit.io/manual/administration/buffering-and-storage
47
#
48
# storage metrics
49
# ---------------
50
# publish storage pipeline metrics in '/api/v1/storage'. The metrics are
51
# exported only if the 'http_server' option is enabled.
52
#
53
storage.metrics on
54
55
[INPUT]
56
Name winlog
57
Channels Setup,Windows PowerShell
58
Interval_Sec 1
59
60
[OUTPUT]
61
name stdout
62
match *
Copied!

Migration to Fluent Bit

From version 1.9.0, td-agent-bit is a deprecated package and will be removed in the future. The correct package name to use now is fluent-bit. Both are currently provided to allow migration.

Installation Packages

The latest stable version is 1.9.3, each version is available on the Github release as well as at https://fluentbit.io/releases/<Major Version>/Major>fluent-bit-<Full Version>-win[32|64].exe:
To check the integrity, use Get-FileHash cmdlet on PowerShell.
1
PS> Get-FileHash fluent-bit-1.9.3-win32.exe
Copied!

Installing from ZIP archive

Download a ZIP archive from above. There are installers for 32-bit and 64-bit environments, so choose one suitable for your environment.
Then you need to expand the ZIP archive. You can do this by clicking "Extract All" on Explorer, or if you're using PowerShell, you can use Expand-Archive cmdlet.
1
PS> Expand-Archive fluent-bit-1.9.3-win64.zip
Copied!
The ZIP package contains the following set of files.
1
fluent-bit
2
├── bin
3
│ ├── fluent-bit.dll
4
│ └── fluent-bit.exe
5
│ └── fluent-bit.pdb
6
├── conf
7
│ ├── fluent-bit.conf
8
│ ├── parsers.conf
9
│ └── plugins.conf
10
└── include
11
│ ├── flb_api.h
12
│ ├── ...
13
│ └── flb_worker.h
14
└── fluent-bit.h
Copied!
Now, launch cmd.exe or PowerShell on your machine, and execute fluent-bit.exe as follows.
1
PS> .\bin\fluent-bit.exe -i dummy -o stdout
Copied!
If you see the following output, it's working fine!
1
PS> .\bin\fluent-bit.exe -i dummy -o stdout
2
Fluent Bit v1.9.x
3
* Copyright (C) 2019-2020 The Fluent Bit Authors
4
* Copyright (C) 2015-2018 Treasure Data
5
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
6
* https://fluentbit.io
7
8
[2019/06/28 10:13:04] [ info] [storage] initializing...
9
[2019/06/28 10:13:04] [ info] [storage] in-memory
10
[2019/06/28 10:13:04] [ info] [storage] normal synchronization mode, checksum disabled, max_chunks_up=128
11
[2019/06/28 10:13:04] [ info] [engine] started (pid=10324)
12
[2019/06/28 10:13:04] [ info] [sp] stream processor started
13
[0] dummy.0: [1561684385.443823800, {"message"=>"dummy"}]
14
[1] dummy.0: [1561684386.428399000, {"message"=>"dummy"}]
15
[2] dummy.0: [1561684387.443641900, {"message"=>"dummy"}]
16
[3] dummy.0: [1561684388.441405800, {"message"=>"dummy"}]
Copied!
To halt the process, press CTRL-C in the terminal.

Installing from EXE installer

Download an EXE installer from the download page. It has both 32-bit and 64-bit builds. Choose one which is suitable for you.
Double-click the EXE installer you've downloaded. The installation wizard will automatically start.
Click Next and proceed. By default, Fluent Bit is installed into C:\Program Files\fluent-bit\, so you should be able to launch fluent-bit as follows after installation.
1
PS> C:\Program Files\fluent-bit\bin\fluent-bit.exe -i dummy -o stdout
Copied!

Installer options

The Windows installer is built by [CPack using NSIS(https://cmake.org/cmake/help/latest/cpack_gen/nsis.html) and so supports the default options that all NSIS installers do for silent installation and the directory to install to.
To silently install to C:\fluent-bit directory here is an example:
1
PS> <installer exe> /S /D=C:\fluent-bit
Copied!
The uninstaller automatically provided also supports a silent un-install using the same /S flag. This may be useful for provisioning with automation like Ansible, Puppet, etc.

Windows Service Support

Windows services are equivalent to "daemons" in UNIX (i.e. long-running background processes). Since v1.5.0, Fluent Bit has the native support for Windows Service.
Suppose you have the following installation layout:
1
C:\fluent-bit\
2
├── conf
3
│ ├── fluent-bit.conf
4
│ └── parsers.conf
5
│ └── plugins.conf
6
└── bin
7
├── fluent-bit.dll
8
└── fluent-bit.exe
9
└── fluent-bit.pdb
Copied!
To register Fluent Bit as a Windows service, you need to execute the following command on Command Prompt. Please be careful that a single space is required after binpath=.
1
% sc.exe create fluent-bit binpath= "\fluent-bit\bin\fluent-bit.exe -c \fluent-bit\conf\fluent-bit.conf"
Copied!
Now Fluent Bit can be started and managed as a normal Windows service.
1
% sc.exe start fluent-bit
2
% sc.exe query fluent-bit
3
SERVICE_NAME: fluent-bit
4
TYPE : 10 WIN32_OWN_PROCESS
5
STATE : 4 Running
6
...
Copied!
To halt the Fluent Bit service, just execute the "stop" command.
1
% sc.exe stop fluent-bit
Copied!
To start Fluent Bit automatically on boot, execute the following:
1
% sc.exe config fluent-bit start= auto
Copied!

[FAQ] Fluent Bit fails to start up when installed under C:\Program Files

Quotations are required if file paths contain spaces. Here is an example:
1
% sc.exe create fluent-bit binpath= "\"C:\Program Files\fluent-bit\bin\fluent-bit.exe\" -c \"C:\Program Files\fluent-bit\conf\fluent-bit.conf\""
Copied!

[FAQ] How can I manage Fluent Bit service via PowerShell?

Instead of sc.exe, PowerShell can be used to manage Windows services.
Create a Fluent Bit service:
1
PS> New-Service fluent-bit -BinaryPathName "C:\fluent-bit\bin\fluent-bit.exe -c C:\fluent-bit\conf\fluent-bit.conf" -StartupType Automatic
Copied!
Start the service:
1
PS> Start-Service fluent-bit
Copied!
Query the service status:
1
PS> get-Service fluent-bit | format-list
2
Name : fluent-bit
3
DisplayName : fluent-bit
4
Status : Running
5
DependentServices : {}
6
ServicesDependedOn : {}
7
CanPauseAndContinue : False
8
CanShutdown : False
9
CanStop : True
10
ServiceType : Win32OwnProcess
Copied!
Stop the service:
1
PS> Stop-Service fluent-bit
Copied!
Remove the service (requires PowerShell 6.0 or later)
1
PS> Remove-Service fluent-bit
Copied!

Compile from Source

If you need to create a custom executable, you can use the following procedure to compile Fluent Bit by yourself.

Preparation

First, you need Microsoft Visual C++ to compile Fluent Bit. You can install the minimum toolkit by the following command:
1
PS> wget -o vs.exe https://aka.ms/vs/16/release/vs_buildtools.exe
2
PS> start vs.exe
Copied!
When asked which packages to install, choose "C++ Build Tools" (make sure that "C++ CMake tools for Windows" is selected too) and wait until the process finishes.
Also you need to install flex and bison. One way to install them on Windows is to use winflexbison.
1
PS> wget -o winflexbison.zip https://github.com/lexxmark/winflexbison/releases/download/v2.5.22/win_flex_bison-2.5.22.zip
2
PS> Expand-Archive winflexbison.zip -Destination C:\WinFlexBison
3
PS> cp -Path C:\WinFlexBison\win_bison.exe C:\WinFlexBison\bison.exe
4
PS> cp -Path C:\WinFlexBison\win_flex.exe C:\WinFlexBison\flex.exe
Copied!
Add the path C:\WinFlexBison to your systems environment variable "Path". Here's how to do that.
Also you need to install git to pull the source code from the repository.
1
PS> wget -o git.exe https://github.com/git-for-windows/git/releases/download/v2.28.0.windows.1/Git-2.28.0-64-bit.exe
2
PS> start git.exe
Copied!

Compilation

Open the start menu on Windows and type "Developer Command Prompt".
Clone the source code of Fluent Bit.
1
% git clone https://github.com/fluent/fluent-bit
2
% cd fluent-bit/build
Copied!
Compile the source code.
1
% cmake .. -G "NMake Makefiles"
2
% cmake --build .
Copied!
Now you should be able to run Fluent Bit:
1
% .\bin\debug\fluent-bit.exe -i dummy -o stdout
Copied!

Packaging

To create a ZIP package, call cpack as follows:
1
% cpack -G ZIP
Copied!