2017-05-12 17 views
1

私はseveralsの異なるログフォーマットを読み込む1つのファイルビートを持っています。Filebeat - 複数行の設定を設定する

うまく動作するフォーマットは、単一のライナーで、Logstashに単一のイベントとして送信されます。 今、私はマルチナーである別のフォーマットを持っています。私はそれを単一のイベントとして読んで、それを解析のためにLogstashに送る必要があります。 これはログ形式の例で、2つのイベントがあります。

error: I READ THIS. sent payload: [{"key": "values"}] 
custom status response: [{"key1": "values"}] 
callback headers: [{"key2": "values"}] 
error stack: [ something really bad happened 
    at here loremisptul (/xx/xx/x) 
    at here loremisptul (/xx/xx/x) 
    at here loremisptul (/xx/xx/x) 
    at here loremisptul (/xx/xx/x) 
    at here loremisptul (/xx/xx/x) 
    at here loremisptul (/xx/xx/x) 
    at here loremisptul (/xx/xx/x) 
    at here loremisptul (/xx/xx/x)] 

error: I AM NOT READING THIS. sent payload: [{"key": "values"}] 
custom status response: [{"key1": "values"}] 
callback headers: [{"key2": "values"}] 
error stack: [ something really bad happened 
    at here loremisptul (/xx/xx/x) 
    at here loremisptul (/xx/xx/x) 
    at here loremisptul (/xx/xx/x) 
    at here loremisptul (/xx/xx/x) 
    at here loremisptul (/xx/xx/x) 
    at here loremisptul (/xx/xx/x) 
    at here loremisptul (/xx/xx/x) 
    at here loremisptul (/xx/xx/x)] 

そして、ここでプロスペクター構成です:

- input_type: log 
    paths: /Users/xxxxx/Downloads/elk/anotherlog/app.stderr.log 
    document_type: logsystemtwo 
    multiline.pattern: '`^=[A-Z]+|^$`' 
    multiline.negate: true 
    multiline.match: after 
- input_type: log 
    paths: /Users/xxxxx/Downloads/elk/mylogs/access.log* 
    document_type: logsystemone 

問題は、最初の複数行です。それは最初の出来事(私はこれを読む)を読むが、それの残りを無視する(私はこれを読んでいない)。

私は多くの異なるconfigurationsを試しましたが、他のイベントを読むことはできません。 常に最初のイベントのみを送信し、残りのイベントは無視します。

私はLogstashの中でもマルチラインを行うことができますが、避けるべきであるdocumentationによると分かります。そこにある

- input_type: log 
    paths: /Users/xxxxx/Downloads/elk/logs/app.stderr.log 
    document_type: error 
    multiline.pattern: '^error: ' 
    multiline.negate: true 
    multiline.match: after 

は言及したいと思います:私はすでに、私は私の場合で動作パターンを発見した

答えて

1

が非常に複雑な構造を持っているとしても、私の場合、私は、Logstashでこれをやって回避しますFilebeatの場合はplaygroundとなり、パターンのプロトタイプ作成に役立ちます。

関連する問題