logstash中可以选择什么选项

What option can be chosen in logastash

我正在使用 logstash 从文件中解析日志,我的问题是 我应该选择在不复制数据的情况下收集所有日志的选项

 start_position => 'beginning'

 start_position => 'end' 

以及这两个选项之间的区别是什么。 谢谢

引用文档:

Choose where Logstash starts initially reading files: at the beginning or at the end. The default behavior treats files like live streams and thus starts at the end. If you have old data you want to import, set this to ‘beginning’

This option only modifies “first contact” situations where a file is new and not seen before. If a file has already been seen before, this option has no effect.

因此,如果您总是想导入整个文件,请使用 beginning。如果您要处理的是某种只有最新内容才重要的流式传输情况,请使用 end。如果您的日志文件每天都在更改名称,请务必使用 beginning。否则当 logstash 第一次看到下几天的文件时,它会跳过它的开头。

我个人想不出任何你不想使用的情况beginning,但也许我很笨。