繁体   English   中英

Logstash / Elasticsearch的Grok模式

[英]Grok pattern for logstash / elasticsearch

我有以下日志文​​件(多行)

[25/Nov/2015:15:25:06 +0000] 28minutes.asf-prod.arte.tv GET /profiles/asf/themes/asf/css/grab.png http_code=302 query= uid=0 php_pid=1634 php_time=0.047 queue_wait=0 request_id="v-b52d24dc-9388-11e5-bf44-22000a5ba31e"
[25/Nov/2015:15:25:13 +0000] karambolage.asf-prod.arte.tv GET /fr/la-devinette-194-karambolage http_code=200 query= uid=0 php_pid=1603 php_time=1.113 queue_wait=0 request_id="v-b865c0c8-9388-11e5-9210-22000a5ba31e"

和下面的过滤器

\[%{HTTPDATE:timestamp}\] %{URIHOST:acquia_vhost} %{WORD:verb} %{NOTSPACE:request} http_code=%{NUMBER:response} query=(%{USER:query})? uid=%{NUMBER:uid} php_pid=%{NUMBER:php_pid} php_time=%{NUMBER:php_time} queue_wait=%{NUMBER:queue_wait} request_id=%{QUOTEDSTRING:request_id}\$

我正在使用http://grokconstructor.appspot.com/do/match#result进行测试,但显示为“不匹配”。

但是我的模式没有任何问题:(感谢您的帮助

最好的祝福,

“ \\ $”表示图案结尾处有一个美元符号。 你没有这样的东西。

通常,一次构建一个元素就可以构建模式。 这样,当它们破裂时,您知道它在哪里。

这是一个工作会议

grok {
      match => { "message" => "\[%{HTTPDATE:timestamp}\] %{URIHOST:acquia_vhost} %{WORD:verb} %{NOTSPACE:request} http_code=%{NUMBER:response} query=(%{NOTSPACE:query})? uid=%{NUMBER:uid} php_pid=%{NUMBER:php_pid} php_time=%{NUMBER:php_time} queue_wait=%{NUMBER:queue_wait} request_id=%{QUOTEDSTRING:request_id}"}
    }

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM