我尝试使用logstach从我们的网站可视化日志。
我们的公寓
input {
file {
path => 'f:/tst/zp/*zp*.log'
type => 'app'
start_position =>'end'
}
}
filter {
multiline {
pattern => ???
what => 'previous'
negate => true
}
}
output {
stdout { codec => rubydebug }
elasticsearch { embedded => true }
}我们的日志示例(企业库)
----------------------------------------
16.08.2012 6:46:40 [1476] [Error] General
Message: Error
System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at ZCommon.Model.Search.VacancySearchArgs.<MakeSql>b__d(String[] x) in d:\Builds\Sources\DM_Zarplata4.2_Retail3\DM_Zarplata\Zarplata4\releases\current\ZCommon4.4\Model\Search\VacancySearchArgs.cs:line 126
----------------------------------------你能帮我处理一下图案吗?我使用http://grokdebug.herokuapp.com/来制作模式,但是模式不起作用。
发布于 2014-02-10 04:35:53
试试这个模式
filter {
multiline {
pattern => "^[0-9]{2}\.[0-9]{2}\.[0-9]{4}"
what => 'previous'
negate => true
}
}这对我很有用。该模式用于筛选日期。
https://stackoverflow.com/questions/21628864
复制相似问题