I'm trying to use fluent-bit to ship logs from log files to telegraf which's listening on a port 8094. I'm able to send data to this port via terminal like this
echo "some_log_data" | nc localhost 8094
but when I'm using fluent-bit formward output plugin to send data to the same port, it's giving this error in the fluent-bit logs
fluent-bit_1 | [2019/11/21 11:14:44] [error] [io] TCP connection failed: localhost:8094 (Connection refused)
fluent-bit_1 | [2019/11/21 11:14:44] [error] [out_fw] no upstream connections available
This's my docker-compose file:
version: '3'
services:
# Define a Telegraf service
telegraf:
image: telegraf
volumes:
- ./telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
ports:
- "8092:8092/udp"
- "8094:8094"
- "8125:8125/udp"
- "9126:9126"
networks:
- mynet
fluent-bit:
image: fluent/fluent-bit:1.3.2-debug
volumes:
- ./fluent-bit:/fluent-bit/etc
- ./access_logs/localhost_access_log:/logs
depends_on:
- telegraf
networks:
- mynet
networks:
mynet:
fluent-bit.conf:
[SERVICE]
Flush 2
Parsers_File parsers.conf
[INPUT]
Name tail
Tag cuic.logs
Path /logs/*.log
Path_Key File_Path
Multiline On
Parser_Firstline start
[OUTPUT]
Name forward
Match *
Host localhost
Port 8094
Tag cuic.logs
telegraf.conf:
[[outputs.file]]
files = ["/tmp/metrics.out"]
data_format = "json"
json_timestamp_units = "1s"
[[inputs.socket_listener]]
service_address = "tcp://:8094"
socket_mode = "777"
data_format = "grok"
grok_patterns = ["%{CUSTOM_LOG}"]
grok_custom_patterns = '''
SOME_GROK_PATTERN
'''
[[aggregators.histogram]]
period = "10s"
drop_original = false
[[aggregators.histogram.config]]
buckets = [0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0]
measurement_name = "access_log"
fields = ["resp_time"]
Can someone please help me figure out what I did wrong?