私のbussiness_logのいくつかのRAWを使用して、私のbussiness_logを解析:GROKフィルタ(Logstash)
2016-11-28 00:00:00.7000 INFO : OneTwoThreeHandler.GetBot
Cannot find a bot: Rak 20000
2016-11-28 00:00:00.7000 INFO : OneTwoThreeHandler.GetBotPlayer
Cannot find a bot: COIN 50000
2016-11-28 00:00:01.4812 INFO : OneTwoThreeHandler.GetBotPlayer
Find a bot: 1219552640:ut:coinu - rak: 6703098 - coin: 2721975
2016-11-28 00:00:01.4812 INFO : OttMatchSolo.Matched
Solo Matched: 1:Rak
私はそのようなOneTwoThreeHandler.GetBot、OneTwoThreeHandler.GetBotPlayer、OneTwoThreeHandler.GetBotPlayer、として "キーワード" に、このログベースを解析しますOttMatchSolo.Matched。魔法使いはそれぞれ "キーワード"のため、残りの生ログは異なります。私はgrok条件を使用することができると思う、誰も私にどのように表示することができますか?これらの具体的なログの具体的な構成を含む各支店で
if [message] =~ /OneTwoThreeHandler\.GetBotPlayer/ {
...
} else if [message] =~/OneTwoThreeHandler\.GetBot/ {
...
} else if [message] =~ /OttMatchSolo\.Matched/ {
...
} else {
...
}
:感謝
ご返信ありがとうございます。私は問題を解決しましたが、ログを再解析する際のトラブルに直面しています。私はstart_position => "beginning"、sincedb_path => "NUL"を追加しました。しかしそれでも動作しません。 – hph2015
@ hph2015 'sincedb_path =>" NUL "はウィンドウ用です。 Linuxの場合は、 "/ dev/null"を使用してください。ウィンドウが表示されても、それでも動作しない場合は、sincedb_pathを別の場所に設定します。これにより、Logstashは別のsincedbファイルを作成し、ログを再解析します。 – baudsp
ありがとうございます@baudsp – hph2015