Skip to content

[QUESTION]: iLogtail 如何配置才能采集历史日志? #669

Answered by linrunqi08
gohonsen asked this question in Help
Discussion options

You must be logged in to vote

在/usr/local/ilogtail目录下创建local_event.json文件,文件的配置包含三个字段,config(采集配置的标识,格式为config#${配置文件绝对路径}),dir(要采集历史文件的目录)和name(要采集的历史文件的名字)
样例如下
[
{
"config": "config#/usr/local/ilogtail/./user_yaml_config.d/test_sample.yaml",
"dir": "/data/log",
"name": "*.log"
}
]

可以通过以下步骤检查是否加载该local_event配置。

  1. local_event.json文件中的内容被清空,则说明Logtail已读取到事件信息。
  2. 检查Logtail安装目录中的ilogtail.LOG文件中是否包含process local event参数。如果local_event.json文件被清空但未查询到process local event参数,可能是因为local_event.json文件内容不合法而被过滤。

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@gohonsen
Comment options

@gohonsen
Comment options

@sunshare
Comment options

@messixukejia
Comment options

Answer selected by messixukejia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
question Further information is requested
4 participants
Converted from issue

This discussion was converted from issue #656 on February 19, 2023 11:34.