Ich habe einen Dateibeat, der mehrere verschiedene Protokollformate liest.Filebeat - Einrichten einer Multiline-Konfiguration
Ein Format, das gut funktioniert, ist ein einzelner Liner, der als einzelnes Ereignis an Logstash gesendet wird. Jetzt habe ich ein anderes Format, das ein Multiliner ist. Ich möchte es als einzelnes Ereignis lesen und es zum Parsen an Logstash senden. Dies ist das Protokollformatbeispiel mit zwei Ereignissen.
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)]
Und hier ist die Prospektor Konfiguration:
- 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
Das Problem mit dem ersten mehrzeilige ist. Es liest das erste Ereignis (ich lese dies), ignoriert aber den Rest davon (ich lese dieses nicht).
Ich habe viele verschiedene configurations versucht, aber ich kann es nicht bekommen, um andere Ereignisse zu lesen. Es sendet immer nur das erste Ereignis und ignoriert den Rest.
Ich weiß, ich könnte die Multiline in Logstash auch tun, aber nach der sollte das vermieden werden. Auch in meinem Fall würde ich tun dies in Logstash vermeiden, da habe ich schon sehr komplexe Strukturen gibt