Fluentd Regexp patterns
Posted nieqibest
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Fluentd Regexp patterns相关的知识,希望对你有一定的参考价值。
举例:apache2 Parser Plugin
expression /^(?<host>[^ ]*) [^ ]* (?<user>[^ ]*) [(?<time>[^]]*)] "(?<method>S+)(?: +(?<path>[^ ]*) +S*)?" (?<code>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^"]*)" "(?<agent>[^"]*)")?$/ time_format %d/%b/%Y:%H:%M:%S %z
example:
192.168.0.1 - - [28/Feb/2013:12:00:00 +0900] "GET / HTTP/1.1" 200 777 "-" "Opera/12.0"
This incoming event is parsed as:
time: 1362020400 (28/Feb/2013:12:00:00 +0900) record: { "user" : nil, "method" : "GET", "code" : 200, "size" : 777, "host" : "192.168.0.1", "path" : "/", "referer": nil, "agent" : "Opera/12.0" }
以上是关于Fluentd Regexp patterns的主要内容,如果未能解决你的问题,请参考以下文章
javascript 选择字符串之间的字符串 - regexp - pattern