HowTo setup Fluent-bit on Sensor

Agenda

  • Supply Fluent-bit software on Sensor
  • Learn configuration parameters for Fluent-bit
  • Request Fluent-bit instance for Sensor

This tutorial teaches how to setup Fluent-bit on the Olimex board with the sensor. 

Before doing this tutorial make sure you read and completed the following tutorials

Supply Software

Supply via SlapOS Panel

Login to the panel and click on Servers (c).

Select the machine on which you want to supply Fluent-bit.

Supply via SlapOS Panel Cont.

Click on the Supply button.

Supply via SlapOS Panel Cont.

Select Fluent-bit.

Supply via SlapOS Panel Cont.

Choose the newest version.

Supply via SlapOS Panel Cont.

Click on Proceed.

Wait until the compilation process has been finished.

Monitor compilation

You can monitor the process by running

tail -f /opt/slapos/log/slapos-node-software.log

on the respective machine.

Configuration Parameters

[INPUT]
    Name   mqtt
    Tag    YOUR_TAG_NAME
    Listen host
    Port   1883

[OUTPUT]
    Name          forward
    Match         YOUR_TAG_NAME
    Host          host
    Port          24224

Request Instance

Request via SlapOS Panel

Go to the SlapOS dashboard and click on the Services (l) button.

Click on the add button.

Request via SlapOS Panel Cont.

Select Fluent-bit.

Request via SlapOS Panel Cont.

Pick the newest version.

Request via SlapOS Panel Cont.

Fill in the Fluent-bit configuration parameters in the Instance Parameter field. You can use the <parameter> tag to specify certain parameters of your instance. The name for the Fluent-bit configuration parameter is conf_text. Because the Instance Parameter itself is written in XML we have to escape our Fluent-bit Configuration File. You can use an Online XML escape tool (for instance appdevtools).

The escaped form of the configuration would be something similar to:

<?xml version="1.0" encoding="UTF-8"?>
<instance>
    <parameter id="input">{
        "name": "mqtt",
        "tag": "YOUR_TAG_NAME",
        "port": 1883
}</parameter>
    <parameter id="output">{
        "name": "forward",
        "match": "YOUR_TAG_NAME",
        "host": "<IP>",
        "port": 24224
}</parameter>
</instance> 

Don't forget to correctly fill in your computer reference, Instance name, url etc.

Finally click Proceed to request the instance.

Monitor instantiation

You can monitor the process by running

tail -f /opt/slapos/log/slapos-node-instance.log

on the respective machine.

Fluentd Instance

This step can take some time.  

In your SlapOS dashboard you can see you newly requested instance.

Instance is ready when the the Monitoring Status is green.

Note the Parameters section - there are the Fluent-bit configuration parameters we defined earlier.

Sensor

Login to your  Sensor and run the following command : 

sudo slapos node

You see that a new service for Fluentd is added.

And the generated Fluent-bit configuration file is located here :

/srv/slapgrid/slappartX/etc/fluent-bit-config-file.cfg

Now your sensor is ready to retrieve data and to send it to, in our case, the IOT Gateway.

Thank You

  • Nexedi SA
  • 147 Rue du Ballon
  • 59110 La Madeleine
  • France
  • +33629024425

For more information, please contact Jean-Paul, CEO of Nexedi (+33 629 02 44 25).