我正在学习使用FluentD。我试着用它发送日志到coralogix。我已经安装了td,并通过使用尾插件来跟踪日志文件并输出插件将其写入另一个目录,从而使它以一种基本的方式工作。因此,我知道我的安装工作,但我不能让http插件发送数据到coralogix。我甚至没有让td-agent.service守护进程运行,在the日志文件中也没有错误信息。我得到的只有来自systemctl状态的以下信息:
ec2-user@ip-172-31-8-39 td-agent$ sudo systemctl状态-l td-agent.service td-agent-agent:基于Fluentd的数据收集器用于加载宝藏数据: loaded (/usr/lib/systemd/system/ td-agent.service;已启用;供应商预置:禁用)活动:自2022-10-03 20:33:54 UTC以来活动:失败(结果:开始-限制);4SagoDocs:https://docs.treasuredata.com/display/public/PD/About+Treasure+Data%27s+Server-Side+Agent进程: 11419 ExecStop=/bin/ -TERM ${code=exited,status=0/SUCCESS)进程: 11467 ExecStart=/opt/td/bin/fluentd $TD_AGENT_LOG_FILE -daemon/var/run/td/td (code=exited,$TD_AGENT_OPTIONS =1/FAILURE)主PID: 11203 (code=exited,status=0/SUCCESS)
03年10月20日:33:54 ip-172-31-8-39.us-west-1计算。内部systemd1: td-agent.service:控制进程退出,code=exited status=1 03 :33:54 ip-172-31-8-39.us-西部-1计算。内部systemd1:未能启动td代理:基于流量的宝藏数据数据收集器。10月3日20:33:54 ip-172-31-8-39.us-西部-1计算。内部systemd1:单元td-代理服务进入失败状态。10月3日20:33:54 ip-172-31-8-39.us-西部-1计算。内部systemd1: td-agent.service失败。10月3日20:33:54 ip-172-31-8-39.us-西部-1计算。内部systemd1: td-代理。服务暂停时间结束,调度重新启动。10月3日20:33:54 ip-172-31-8-39.us-西部-1计算。内部systemd1:停止td-代理:基于Fluentd的宝藏数据数据收集器。内部systemd1:开始请求对td-agent.service 03 :33:33:54 ip-172-31-8-39.us-1计算内部systemd1:未能启动Treasure :基于Fluentd的宝藏数据数据收集器。10月3日20:33:54 ip-172-31-8-39.us-西部-1计算。内部systemd1:单元td-代理服务进入失败状态。10月3日20:33:54 ip-172-31-8-39.us-西部-1计算。内部systemd1: td-agent.service失败。ec2-user@ip-172-31-8-39 td-agent$ sudo systemctl状态-l td-agent.service
我的td-agent.conf文件是:
@type tail
format none
read_from_head true
tag coralogix
path /var/log/td-agent/coralogix/external/*.log
pos_file /var/log/td-agent/coralogix/external/logfile.pos
</source>
<match coralogix>
@type http
endpoint "https://api.coralogix.com/logs/rest/singles"
headers {"private_key":15156465465 -Private Key numbers -928989023c762e}
retryable_response_codes 503
error_response_as_unrecoverable false
<buffer>
@type memory
chunk_limit_size 5MB
compress gzip
flush_interval 1s
overflow_action block
retry_max_times 5
retry_type periodic
retry_wait 2
</buffer>
<secondary>
#If any messages fail to send they will be send to STDOUT for debug.
@type stdout
</secondary>
</match>
发布于 2022-10-04 21:57:31
似乎您错过了配置的顶部。不知道是复制粘贴错误还是错误。
在这里( https://coralogix.com/docs/fluentd/ ),您可以找到一个关于如何配置流畅性的示例。
同样-试运行将记录更多关于开始错误的信息。干杯。
https://stackoverflow.com/questions/73940643
复制相似问题