Fluentbit not receiving message on Debian 12

69 Views Asked by At

Im trying to use fluentbit to manage the logs of my system. I have installed fluentbit v2.1.10 in a Debian 12 machine following the manual instructions. In parallel i have installed the same version of fluentbit in an Ubuntu 22.04 to test some things. In the Ubuntu machine i receive the messages correctly but in the Debian machine the message content is null. (im sending the message in the exact same way, and the configuration files in both machines are the same).

Im using the following configuration file:

@SET    outputs_path=outputs
@SET    forward_host=0.0.0.0
@SET    forward_port=5170

[SERVICE]
    Flush       1
    Daemon      off
    Log_Level   debug

[INPUT]
    Name         forward
    Listen       ${forward_host}
    Port         ${forward_port}

[OUTPUT]
    Name        file
    Match       *
    Path        ${outputs_path}
    file        registries.logs

And the script im using to test it is:

from fluent import sender

HOST = '0.0.0.0'
PORT = 5170
TAG = 'app'

class FluentbitLogger():

    logger = None

    def __init__(self, host, port, tag) -> None:
        self.logger = sender.FluentSender(tag, host, port)
    
    def _send(self, level, type, action, message, label):
        self.logger.emit(label=label, data={'level': level, 'type': type, 'action': action, 'message': message})
    
    def info(self, type, action, message, label=None):
        self._send('INFO', type, action, message, label)
    
    def error(self, type, action, message, label=None):
        self._send('ERROR', type, action, message, label)
    
    def warning(self, type, action, message, label=None):
        self._send('WARNING', type, action, message, label)

    def debug(self, type, action, message, label=None):
        self._send('DEBUG', type, action, message, label)


logger = FluentbitLogger(HOST, PORT, TAG)
logger2 = FluentbitLogger('<ip of debian node>', PORT, TAG)

# Testing
logger.info('prueba_I', "Prueba de info", "Esto es una prueba de INFO", "extra")
logger2.info('prueba_I', "Prueba de info", "Esto es una prueba de INFO", "extra")

As you can see im sending exactly the same to the ubuntu machine (logger) and the debian machine (logger2). As i already said the fluentbit configuration file is the same in both cases.

In ubuntu machine the result is as expected: app.extra: [1700038958.000000000, {"level":"INFO","type":"prueba_I","action":"Prueba de info","message":"Esto es una prueba de INFO"}]

But in the debian machine the result is: app.nodo: [13051431720119697408.000000000, (null)]

As you can see the tag is correct but the data is null. It should be the same result in both machines.

I have tested this in two more machines (one ubuntu and one debian) and i have got the same result (ubuntu correct but debian null) so i suppose it has something to do with the architecture.

0

There are 0 best solutions below