Logstash is not reading all the logs

本文探讨了Logstash在读取特定模式文件方面的配置问题,包括如何正确设置路径以便能够读取当前及历史文件,并解决了配置中忽略旧文件的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

https://discuss.elastic.co/t/logstash-is-not-reading-all-the-logs/61302

I want my logstash to read the following pattern of files from the logs directory

Current Date File -> server.log
Historical File Name -> server.log.yyyy-mm-dd

In my system I have 22 files in my logs folder

server.log
server.log.2016-09-22
server.log.2016-09-21
server.log.2016-09-20
server.log.2016-09-19
server.log.2016-09-18
server.log.2016-09-17

and so on in this way everyday files are renamed with date appended to name and current date file is named as server.log

my conf file is as follows

input {

file {
type => "serverlog"
path => ["E:/Code_Athon/test/test1/*server.log*"]
start_position => "beginning"

}

}

I found the above configuration does not work for me and is reading only server.log file. No past files :frowning:

I also tried the below configurations

input {

file {
type => "serverlog"
path => ["E:/test/test1/server.log","E:/test/test1/server.log*"]
start_position => "beginning"

}

}

In the above configuration i observed that logstash picked up server.log and server.log.2016-09-21 and it does not go to other
files in past , may be because of performance issues or worker thread , but I did not get any error on console. :frowning:

input {

file {
type => "serverlog"
path => ["E:/test/test1/server.log","E:/test/test1/server.log*"]
path => ["E:/test/test1/server.log.--*"]
start_position => "beginning"

}

}

Even this configuration does not solve my issue.

Can anyone suggest what should be my configuration so that my lohgstash can read the current file , past file and daily rollover file
named as server.log

Am i missing any configurations here ?

================================================================================

You may need to change the ignore_older8 setting for the file input plugin in order to make Logstash process older files.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值