Search code examples
fluent-bit

send dummy logs to my docker fluentbit agent


I have installed fluentbit agent on my docker and also exposed the port 24224 to my localhost.

How do I send a dummy log to my fluentbit docker agent ?

For what I understand is when I will send a log to :24224 somehow, the agent will do some processing on logs and will send it to localhost:8006 which should be captured in my otel-collector.

I have done all the setup, all I missing is -- a dummy log to test the scenario.

Thanks in advance !


Solution

  • docker run --log-driver=fluentd -t ubuntu echo "Testing a log message"

    The command is mostly self explanatory for docker users, I have added a description for the ease of understanding.


    The command simply follows docker run syntax

    docker run [OPTIONS] IMAGE [COMMAND]

    IMAGE=ubuntu This command simply uses the ubuntu docker image.

    COMMAND= echo "Testing a log message" runs the basic echo command.

    the main helpful portion is log-driver

    Appearantly, ubuntu docker image supports several log drivers, this list also includes fluend -- which will automatically send the message to localhost:24224 without specifying port !


    There might be other tools which can be configured to send logs to localhost:24224, this is one of those many solutions which came handy !