Health

Health input plugin allows you to check how healthy a TCP server is. It does the check by issuing a TCP connection every a certain interval of time.

Configuration Parameters

The plugin supports the following configuration parameters:

Key Description
Host Name of the target host or IP address to check.
Port TCP port where to perform the connection check.
Interval_Sec Interval in seconds between the service checks. Default value is 1.
Internal_Nsec Specify a nanoseconds interval for service checks, it works in conjunction with the Interval_Sec configuration key. Default value is 0.
Alert If enabled, it will only generate messages if the target TCP service is down. By default this option is disabled.
Add_Host If enabled, hostname is appended to each records. Default value is false.
Add_Port If enabled, port number is appended to each records. Default value is false.

Getting Started

In order to start performing the checks, you can run the plugin from the command line or through the configuration file:

Command Line

From the command line you can let Fluent Bit generate the checks with the following options:

  1. $ fluent-bit -i health://127.0.0.1:80 -o stdout

Configuration File

In your main configuration file append the following Input & Output sections:

  1. [INPUT]
  2. Name health
  3. Host 127.0.0.1
  4. Port 80
  5. Interval_Sec 1
  6. Interval_NSec 0
  7. [OUTPUT]
  8. Name stdout
  9. Match *

Testing

Once Fluent Bit is running, you will see some random values in the output interface similar to this:

  1. $ fluent-bit -i health://127.0.0.1:80 -o stdout
  2. Fluent Bit v1.x.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. [2016/10/07 21:37:51] [ info] [engine] started
  8. [0] health.0: [1475897871, {"alive"=>true}]
  9. [1] health.0: [1475897872, {"alive"=>true}]
  10. [2] health.0: [1475897873, {"alive"=>true}]
  11. [3] health.0: [1475897874, {"alive"=>true}]