This guide describes how to send user definitive logs that uses in Hive Analytics v2 via fluentd.

Fluentd Install

  – We recommend installing the tdagent version 1.x.
  – The tdagent libraries are provided for each languages.  (https://docs.fluentd.org/language-bindings)

Installing tdagent

  • http://docs.fluentd.org/articles/install-by-rpm
  • Edit the tdagent settings file

 


Fluentd Default Settings

  • Log file: The default path of log file is /var/log/td-agent, and the tdagent.log file is located the sub folder.
  • Event: Event in fluentd means record and log.
  • <source>: <source> enables to receive various input and many plugins are able to use by using @ type.
  • <match>: It handles the input event that sent via <source>.

 


Fluentd Plugin

  • Check and install the plugin: Install the plugin you need after checking the list of plugins.
    (The plugins such as tail, forward and stdout are provided in default, but others like forest need to be install separately.)

  • tag: Tag is a value that consists of Event, and the &lt;match&gt; section handles the value matched with tag.

 

[Input Plugin]

  • in_tail: The in_tail plugin reads data by using the tail command.
  • in_forward: Generally, it is used for receiving the data from other fluentd nodes.

 

[Output Plugin]

The output plugin defined in the <match> section defines the settings for buffering and flushing as the <buffer> sub section of the <match> section.

  • output_stdout: Exports event logs with stdout and mainly uses for debugging.
  • output_forward: Uses when sending event logs to other fluentd nodes.
  • fluentpluginforest : Enables to save the log files using a tag name. (By setting as below, logs can be saved in local.)

 


Usage examples of fluentd

Using fluentd enables to send logs with the methods as below. For more details, click the links below.

 


Edit settings

  • Check the tdagent.conf context
  • Re-start tdagent