[SERVICE]
Flush 1
Daemon off
Log_Level info
[INPUT]
Name tcp
Listen 0.0.0.0
Port 5140
Format json
Buffer_Size 10240
Chunk_Size 1024
Tag app.*
[OUTPUT]
Name stdout
Match app.*
Required libraries are already installed. This is python3 code :
import os
import time
import logging
import requests
import socket
import json
import ipaddress
from logging.handlers import SocketHandler
from pythonjsonlogger import jsonlogger
from fluent import sender, event
fluent_host = '127.0.0.1'
fluent_port = 5140
logger = sender.FluentSender('app', host='127.0.0.1', port=5140)
logger.emit('follow', {"from": "userA", "to": "userB"})
The error I am getting is :
But upon running the command from command line terminal, the fluentbit is successfully able to read the message.
echo '{"from": "userA", "to": "userB"}' | ncat '127.0.0.1' 5140
Is there some issue with my code or the emit method has some bug ? Could someone please help here.
Thank you
Docker image used for fluentbit : fluent/fluent-bit:latest. This is fluentbit configuration :
Required libraries are already installed. This is python3 code :
The error I am getting is :
But upon running the command from command line terminal, the fluentbit is successfully able to read the message.
echo '{"from": "userA", "to": "userB"}' | ncat '127.0.0.1' 5140
Is there some issue with my code or the emit method has some bug ? Could someone please help here. Thank you