0

My log file has a single line (taken from the tutorial log file):

55.3.244.1 GET /index.html 15824 0.043 

My conf file looks something like this:

input {
  file {
    path => "../http.log"
    type => "http"
  }
}

filter {
  grok {
    type => "http"
    match => [ "message", "%{IP:client}" ]
  }
}

I tested my grok filter with the grok debugger and it worked. I'm at a loss of what I am doing wrong. I get a [0] "_grokparsefailure" every time

4

1 に答える 1

2

grok フィルターのデバッグに関する限り、このリンク ( http://grokdebug.herokuapp.com/ ) を使用できます。このリンクには、非常に包括的なパターン検出機能があり、出発点として適しています。

ログメッセージの残りの部分ではなく IP のみを気にする場合は、次のフィルターが機能するはずです。

%{IP:host} %{GREEDYDATA:remaining_data}

デバッグする最善の方法は、logstash 用のプラグインを使用してパターンをデバッグするstdinことです。stdoutgrok

ここでドキュメントを見つけることができますhttp://logstash.net/docs/1.4.2/

于 2014-11-21T20:14:25.940 に答える