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

Fluentd Regexp patterns

时间:2018-10-28 20:52:11      阅读:344      评论:0      收藏:0      [点我收藏+]

标签:span   pac   this   use   apach   his   div   referer   class   

举例: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

标签:span   pac   this   use   apach   his   div   referer   class   

原文地址:https://www.cnblogs.com/nieqibest/p/9866732.html

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