码迷,mamicode.com
首页 > 其他好文 > 详细

logstash过滤配置

时间:2018-02-04 18:04:28      阅读:158      评论:0      收藏:0      [点我收藏+]

标签:match   out   lte   sage   eve   filter   mat   arc   pac   

input {
redis {
host => "127.0.0.1"
port => 6380
data_type => "list"
key => "phgj-list"
}
}
filter {
if [fields][tag] == "ph130-ingcn01" {
grok {
match => {"message" => "\[(?<api_time>%{NOTSPACE}%{SPACE}%{NOTSPACE})\]\s*\<%{NOTSPACE:api_queue}\>\s*\-\s*%{NOTSPACE:api_level}\s*\-\s*%{NOTSPACE:api_method}.*"}
}
date {
match => ["api_time", "yyyy/MM/dd HH:mm:ss.SSS"]
target => "@timestamp"
}
}
if [fields][tag] == "ph130-phing" {
grok {
match => {"message" => "\[(?<api_time>%{NOTSPACE}%{SPACE}%{NOTSPACE})\]\s*\<%{NOTSPACE:api_queue}\>\s*\-\s*%{NOTSPACE:api_level}\s*\-\s*%{NOTSPACE:api_method}.*"}
}
date {
match => ["api_time", "yyyy/MM/dd HH:mm:ss.SSS"]
target => "@timestamp"
}
}
if [fields][tag] == "ph130-route" {
grok {
match => {"message" => "\[(?<api_time>%{NOTSPACE}%{SPACE}%{NOTSPACE})\]\s*\<%{NOTSPACE:api_queue}\>\s*\-\s*%{NOTSPACE:api_level}\s*\-\s*%{NOTSPACE:api_method}.*"}
}
date {
match => ["api_time", "yyyy/MM/dd HH:mm:ss.SSS"]
target => "@timestamp"
}
}
if [fields][tag] == "ph130-savetask" {
grok {
match => {"message" => "\[(?<api_time>%{NOTSPACE}%{SPACE}%{NOTSPACE})\]\s*\<%{NOTSPACE:api_queue}\>\s*\-\s*%{NOTSPACE:api_level}\s*\-\s*%{NOTSPACE:api_method}.*"}
}
date {
match => ["api_time", "yyyy/MM/dd HH:mm:ss.SSS"]
target => "@timestamp"
}
}
if [fields][tag] == "ph130-deletetask" {
grok {
match => {"message" => "\[(?<api_time>%{NOTSPACE}%{SPACE}%{NOTSPACE})\]\s*\<%{NOTSPACE:api_queue}\>\s*\-\s*%{NOTSPACE:api_level}\s*\-\s*%{NOTSPACE:api_method}.*"}
}
date {
match => ["api_time", "yyyy/MM/dd HH:mm:ss.SSS"]
target => "@timestamp"
}
}
if [fields][tag] == "ph130-endtime" {
grok {
match => {"message" => "\[(?<api_time>%{NOTSPACE}%{SPACE}%{NOTSPACE})\]\s*\<%{NOTSPACE:api_queue}\>\s*\-\s*%{NOTSPACE:api_level}\s*\-\s*%{NOTSPACE:api_method}.*"}
}
date {
match => ["api_time", "yyyy/MM/dd HH:mm:ss.SSS"]
target => "@timestamp"
}
}
}
output {
if [fields][tag] == "ph130-ingcn01" {
elasticsearch {
hosts => ["127.0.0.1:9200"]
index => "iisph130-ingcn01-log"
}
}
if [fields][tag] == "ph130-phing" {
elasticsearch {
hosts => ["127.0.0.1:9200"]
index => "iisph130-phing-log"
}
}
if [fields][tag] == "ph130-route" {
elasticsearch {
hosts => ["127.0.0.1:9200"]
index => "iisph130-route-log"
}
}
if [fields][tag] == "ph130-savetask" {
elasticsearch {
hosts => ["127.0.0.1:9200"]
index => "iisph130-savetask-log"
}
}
if [fields][tag] == "ph130-deletetask" {
elasticsearch {
hosts => ["127.0.0.1:9200"]
index => "iisph130-deletetask-log"
}
}
if [fields][tag] == "ph130-endtime" {
elasticsearch {
hosts => ["127.0.0.1:9200"]
index => "iisph130-endtime-log"
}
}
}

logstash过滤配置

标签:match   out   lte   sage   eve   filter   mat   arc   pac   

原文地址:https://www.cnblogs.com/liqing1009/p/8413565.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!