你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
搜索:
没有找到相关结果
shitangjiejie
赞同来自: muou 、vlgnaw
yuzerk
赞同来自: vlgnaw
要回复问题请先登录或注册
生活很美好,万一被人误会肯定有自己的原因,受不了就解释,不想解释就看淡些,自己何苦为难自己
2 个回复
shitangjiejie
赞同来自: muou 、vlgnaw
# Paths that should be crawled and fetched. Glob based paths.
paths:
- /var/logs/xx.log
document_type: xx
paths:
- /data/logs/aa.log
document_type: aa
然后在logstash里配置对应的type
output {
if [type] =="xx"{
elasticsearch {
hosts => ["*.*.*.*:9200"]
index => "xx-%{+YYYY.MM.dd}"
document_type => "log"
}
}
if [type] =="aa"{
elasticsearch {
hosts => ["*.*.*.*:9200"]
index => "aa-%{+YYYY.MM.dd}"
document_type => "log"
}
}
}
你试下
yuzerk
赞同来自: vlgnaw
processors:
- drop_fields:
fields:
- beat
fields:
host: xxxx.xxxx.xxxx.xxxx
logging.level: info
fields_under_root: true
filebeat.prospectors:
- multiline.pattern: ^\[?[0-9]{4}-[0-9]{2}-[0-9]{2}
paths:
- /xxxxxxx/xxxx/xxxx/xxx/*.log
scan_frequency: 5s
multiline.match: after
fields:
indexname: logs_xxxxx
input_type: log
multiline.negate: true
close_inactive: 2m
fields_under_root: true
output.logstash:
compression_level: 3
hosts:
- xxxx.xxxx.xxxx.xxxx:5044
然后可以在logstash.conf 里配置
input{
beats{
port => 5044
}
}
output{
elasticsearch{
hosts => ["http://localhost:9200"]
index => "%{indexname}-%{+YYYY-MM-dd}"
}
}
希望能够帮到你