作者:工农大路店NOKIA客户服务中心 | 来源:互联网 | 2023-05-17 18:29
#filebeat#配置-input_type:log#Pathsthatshouldbecrawledandfetched.Globbasedpaths.pat
- input_type: log
paths:
- /var/log**.log
ignore_older: 1m
output.logstash:
hosts: ["localhost:5046"]
./filebeat -e -c filebeat.yml
input {
beats {
port =>5046
}
}
filter {
mutate {
gsub => [
"source" , "^(\/[^\/^]+){2}/","" ]
}
}
output {
file {
path => "/tmp/file-to-log/%{source}"
codec => line {
format => "%{message}"
}
}
}
./logstash -f test-filebeat.conf