From 2ef384e4920bf1f799a00ee86fe53e26b2b06529 Mon Sep 17 00:00:00 2001 From: Neway Liu Date: Mon, 11 Nov 2013 22:43:55 +0800 Subject: [PATCH] remove the complicated regex of the drop filter, because stackstrace is already combined into one record. also remove the mutate filter, using output format instead. --- support/logstash/error_collector/shipper.conf | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/support/logstash/error_collector/shipper.conf b/support/logstash/error_collector/shipper.conf index d3a9abf0..d804bcba 100644 --- a/support/logstash/error_collector/shipper.conf +++ b/support/logstash/error_collector/shipper.conf @@ -10,12 +10,8 @@ input { } filter { - if [type] != "showcase" or [message] !~ /(ERROR)|(^.+Exception: .+)|(^\s+at .+)|(^\?s+... \d+ more)|(^\s*Caused by:.+)/{ - drop {} # 将非错误日志过滤掉 - } - - mutate { - replace => [ "message", "[%{host}]-%{message}" ] # 将产生日志的host记录在日志记录中 + if [type] != "showcase" or [message] !~ /(ERROR)|(^.+Exception: .+)/{ + drop {} # 将非错误日志过滤掉,因为之前已经将stacktrace拼接成一条记录,所以这里的过滤条件也比较简单,不需要复杂的正则表达式,只要带Error或者Exception就可以了 } }