良玉的博客 点点滴滴,积水成河_良玉的博客_页游、手游linux运维工程师之路

nginx 错误日志格式的正则匹配,filebeat

nginx 错误日志格式:

2018/08/25 11:23:36 [error] 28388#0: *14549 open() "/var/www/zjzc-web-frontEnd/images/account/profitBttom2.png" failed (2: No such file or directory), client: 10.168.102.19, server: localhost,

request: "GET /images/account/profitBttom2.png HTTP/1.1", host: "wenjinbao.winfae.com", referrer: "https://wenjinbao.winfae.com/products/productList.html"


filter {

grok {

match => [ "message" , "(?<timestamp>%{YEAR}[./-]%{MONTHNUM}[./-]%{MONTHDAY}[- ]%{TIME}) \[%{LOGLEVEL:severity}\] %{POSINT:pid}#%{NUMBER}: %{GREEDYDATA:errormessage}(?:, client: (?

<remote_addr>%{IP}|%{HOSTNAME}))(?:, server: %{IPORHOST:server}?)(?:, request: %{QS:request})?(?:, upstream: (?<upstream>\"%{URI}\"|%{QS}))?(?:, host: %{QS:request_host})?(?:, referrer:

\"%{URI:referrer}\")?"]

}

}


标签: nginx.err.log.formatfilebeat

作者:良玉 分类:Nginx 浏览:409 评论:0
留言列表
发表评论
来宾的头像