简体   繁体   English

rsyslog - imfile-state 配置含义

[英]rsyslog - imfile-state configuration meanings

In a rsyslog directory for a service I am working with, there are a number of imfile-state files (for example, imfile-state:163613:604cabbcd415ea81 ).在我正在使用的服务的 rsyslog 目录中,有许多 imfile-state 文件(例如, imfile-state:163613:604cabbcd415ea81 )。 As far as I am aware, Rsyslog must keep track of which parts of the monitored file are already processed.据我所知,Rsyslog 必须跟踪受监控文件的哪些部分已被处理。 This is done in so-called "state files".这是在所谓的“状态文件”中完成的。 In these files, the following info can be found:在这些文件中,可以找到以下信息:

{ "filename": "\/path\/to\/file.log", "prev_was_nl": 0, "curr_offs": 17929530, "strt_offs": 17929530 }

I am unsure on what the following mean:我不确定以下内容是什么意思:

  • prev_was_nl prev_was_nl
  • curr_offs curr_offs
  • strt_offs strt_offs

I can't seem to find anything about them online - can anyone shed some light for me?我似乎无法在网上找到任何关于他们的信息 - 任何人都可以为我提供一些启示吗?

You are correct, to keep track of which parts of the monitored file are already processed, rsyslog uses the so-called “state files” that are created in the rsyslog working directory - global(workDirectory) - and are read on startup to resume monitoring after a shutdown.您是对的,为了跟踪已处理的受监控文件的哪些部分,rsyslog 使用在 rsyslog 工作目录 - global(workDirectory)中创建的所谓“状态文件” - 并在启动时读取以恢复监控关机后。

According to the rsyslog documentation , there is intentionally no more precise description of the state file naming , as this is an implementation detail and may change as needed.根据rsyslog 文档故意没有对状态文件命名进行更精确的描述,因为这是一个实现细节,可能会根据需要进行更改。

Looking into the source code of the imfile module, doesn't give much more information either.查看imfile模块的源代码,也没有提供更多信息。

So to now answer the question;所以现在回答这个问题; I don't know .我不知道 If you really want to know, you will probably have to ask a developer.如果您真的想知道,您可能不得不询问开发人员。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM