input {
file {
path => ["/usr/local/test/logstash-5.0.0/file/gzns/access*.log"]
}
}
二、采集文件,设置文件编码(logstash默认utf-8,如果编码不一致,中文就会乱码)
input{
file {
path => ["/usr/local/test/logstash-5.0.0/file/szyh/onlinestdout*.log"]
codec => plain {
charset => "GB2312"
}
}
}
三、采集文件,多行日志处理,匹配开始
input{
file {
path => ["/usr/local/test/logstash-5.0.0/file/gzns/aws/SystemOut*.log"]
codec => multiline {
patterns_dir => ["/usr/local/test/logstash-5.0.0/etc/patterns"]
pattern => "%{T_AWS_START}"
negate => true
what => "previous"
}
}
}
四、采集文件,多行日志处理,匹配结束
input{
file {
path => ["/usr/local/test/logstash-5.0.0/file/gzns/hx/DEP*"]
codec => multiline {
pattern => "BEFORE READ QUEUE"
negate => true
what => "next"
}
}
}