我尝试配置logstash以与elasticsearch配合使用,但我无法读取我的日志文件。
我的日志模式是:
17:06:08.915 TKD [DefaultQuartzScheduler_Worker-1] INFO
javax.mail - Tables of loaded providers
17:10:53.767 TKD [DefaultQuartzScheduler_Worker-6] INFO application - Starting
Jobing [company.Job]
如何配置它以获取[日期时间] [TKD] [DefaultQuartzScheduler] [等级] [应用] [消息]?
我的字段可以像这样填充:
[DateTime] = 17:06:08.915
[TKD] = TKD
[DefaultQuartzScheduler] = DefaultQuartzScheduler_Worker-1
[等级] =信息
[app] = javax.mail
[Message] =加载的提供者表
这是我的conf文件:
input {
file {
add_field => [ 'host', 'my-dev-host' ]
path => 'c:\tmp\utracking.log'
type => 'app'
format => 'plain'
}
}
output {
elasticsearch_http {
host => 'localhost'
port => 9200
type => 'app'
flush_size => 10
}
}
filter {
multiline {
type => 'app'
pattern => '^[^\[]'
what => 'previous'
}
}