-1

以下のようなログファイルがあります。logstash を使用してこのファイルを解析したいと考えています。

2015-06-10 05:11:37,799 [good][status] [ErrorAttribute - AN EXCEPTION OCCURED: 
Exception Occured1
Exception Occured1
Exception Occured1
Exception Occured1
Exception Occured1
Exception Occured1
Exception Occured1
]2015-06-10 05:36:35,517 [50][ERROR] [ErrorAttribute - AN EXCEPTION OCCURED: 
Exception DiffernetOccured1
Exception DiffernetOccured1
Exception DiffernetOccured1
Exception DiffernetOccured1
Exception DiffernetOccured1
Exception DiffernetOccured1
Exception DiffernetOccured1
]

上記のファイルを次のフィールド形式のように解析したい

@timestamp - 2015-06-10 05:11:37,799
Quality - good
Status- Pass
Details - ErrorAttribute - AN EXCEPTION OCCURED: 
Exception Occured1
Exception Occured1
Exception Occured1
Exception Occured1
Exception Occured1
Exception Occured1
Exception Occured1

ログ情報に多くの行が含まれているため、grok 式を使用したファイルの最後までこの手順を続行したいのですが、grokparse は失敗します。grok が 1 行ずつ申請してくれることを願っています。

情報をこのような個別のイベントに解析して 1 つのイベントとして処理したい

2015-06-10 05:11:37,799 [50][ERROR] [ErrorAttribute - AN EXCEPTION OCCURED: 
Exception Occured1
Exception Occured1
Exception Occured1
Exception Occured1
Exception Occured1
Exception Occured1
Exception Occured1
]

そしてこれは別のイベントとして

2015-06-10 05:36:35,517 [50][ERROR] [ErrorAttribute - AN EXCEPTION OCCURED: 
Exception DiffernetOccured1
Exception DiffernetOccured1
Exception DiffernetOccured1
Exception DiffernetOccured1
Exception DiffernetOccured1
Exception DiffernetOccured1
Exception DiffernetOccured1
]

Logstash Filters でこれを達成するにはどうすればよいですか。

4

2 に答える 2

2

複数行のコーデックまたはフィルタを使用して、行を 1 つのイベントに結合して処理する必要があります。

于 2015-06-12T00:23:59.807 に答える
-1

複数行フィルターを使用してメッセージを 1 つのイベントにグループ化し、分割フィルターを使用して多くのイベントに分割し、Logstash の情報を解析しました。

@Alain さん、ご提案ありがとうございます。

于 2015-06-12T14:45:21.140 に答える