Installing Fluentd using .msi Installer (Windows)
This article explains how to install td-agent, the stable Fluentd distribution package maintained by Treasure Data, Inc, on Windows.
Table of Contents
What is td-agent?
Fluentd is written in Ruby for flexibility, with performance sensitive parts written in C. However, casual users may have difficulty installing and operating a Ruby daemon.
That’s why Treasure Data, Inc is providing the stable distribution of Fluentd, called td-agent
. The differences between Fluentd and td-agent can be found here.
For Windows, we’re using the OS native .msi Installer to distribute td-agent.
Step 1: Install td-agent
Please download the .msi
file from here, and install the software.
Step 2: Run td-agent from Command Prompt
First, please prepare your config file located at C:/opt/td-agent/etc/td-agent/td-agent.conf
. The config below is the simplest example to output any incoming records to td-agent’s log file.
<source> @type forward </source> <match test.**> @type stdout </match>
After you’ve installed .msi package, you’ll see the program called Td-agent Command Prompt
installed. Please double click this icon in the Windows menu (below is how it looks like on Windows Server 2012).
In the prompt, please execute the command below to launch td-agent process.
> fluentd -c etc\td-agent\td-agent.conf
Then, please launch another Td-agent Command Prompt
and type the command below. This will send a record to td-agent process.
> echo {"message":"hello"} | fluent-cat test.event
It’s working properly if td-agent process outputs the message test.event: {"k", "v"}
.
Step 3: Register td-agent to Windows service
Next, let’s register td-agent to Windows service to permanently run as a server process. Please execute Td-agent Command Prompt
again but with administrative privilege, and type the two commands below.
> fluentd --reg-winsvc i > fluentd --reg-winsvc-fluentdopt '-c C:/opt/td-agent/etc/td-agent/td-agent.conf -o C:/opt/td-agent/td-agent.log'
Step 4: Run td-agent as Windows service
Please guide yourself to Control Panel -> System and Security -> Administrative Tools -> Services
, and you’ll see Fluentd Windows Service
is listed.
Please double click Fluentd Window Service
, and click Start
button. Then the process will be executed as Windows Service.
The log file will be located at C:/opt/td-agent/td-agent.log
as we specified in Step 3.
Step 5: Install Plugins
Open Td-agent Command Prompt
and use fluent-gem
command.
> fluent-gem install fluent-plugin-xyz --version=1.2.3
Next Steps
You’re now ready to collect your real logs using Fluentd. Please see the following tutorials to learn how to collect your data from various data sources.
- Basic Configuration
- Application Logs
- Examples
Please refer to the resources below for further steps.
If this article is incorrect or outdated, or omits critical information, please let us know. Fluentd is a open source project under Cloud Native Computing Foundation (CNCF). All components are available under the Apache 2 License.