Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support pulling log configuration from remote HTTP sources. #895

Closed
wants to merge 0 commits into from

Conversation

luoyuLianga
Copy link
Contributor

Support pulling log configuration from remote HTTP sources.

  1. 开启conf/logs.toml采集文件配置
    image
    enable = true 打开开关
    send_to = "127.0.0.1:8081" 填充上报地址
    image
    关闭掉采集容器(根据需要)

  2. 开启从远端拉取配置服务
    image
    image

  3. 开启从文件采集服务
    image
    image

  4. 验证
    启动categraf:./categraf --test --inputs logs
    日志:
    image
    修改远端拉取服务,将configs中的logs1修改为logs
    远端拉取配置日志:
    image
    categraf日志:
    image
    尝试写入日志到目标文件:echo "111" >> 1.txt

文件采集服务日志:
image

@luoyuLianga
Copy link
Contributor Author

有什么考虑不足的,希望给一些建议

@luoyuLianga
Copy link
Contributor Author

遇到一个问题:
v0.3.60版本:
启动方式:./categraf --test --inputs logs

如果服务未启动的时候,给目标采集文件echo写入数据。
image

启动采集文件服务,启动拉取配置服务
image
image

启动categraf
image

查看采集文件服务:
image
会发现将未启动服务的数据采集到了。好奇怪,想知道为什么

@luoyuLianga
Copy link
Contributor Author

遇到一个问题: v0.3.60版本: 启动方式:./categraf --test --inputs logs

如果服务未启动的时候,给目标采集文件echo写入数据。 image

启动采集文件服务,启动拉取配置服务 image image

启动categraf image

查看采集文件服务: image 会发现将未启动服务的数据采集到了。好奇怪,想知道为什么

了解了,有一个游标的概念。会记录文件的offset,通常是在/opt/categraf/run
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant