Handle multiline Logstash events per file.
* modules/openstack_project/files/logstash/log-pusher.py: Add a filename field to logstash events that can be used to associate multiline events in files to their appropriate parents in the same file. * modules/openstack_project/templates/logstash/indexer.conf.erb: Add stream_identities to the mutliline filters that use the source host and file name to determine relationships between mutliline events. Change-Id: Ia325c0e1257131ab1b721c4df8f70f6bea1d0b99 Reviewed-on: https://review.openstack.org/30953 Reviewed-by: Jeremy Stanley <fungi@yuggoth.org> Approved: James E. Blair <corvus@inaugust.com> Reviewed-by: James E. Blair <corvus@inaugust.com> Tested-by: Jenkins
This commit is contained in:
parent
9ed2be3098
commit
c9d484e797
@ -133,6 +133,7 @@ class LogRetriever(threading.Thread):
|
||||
|
||||
def _parse_fields(self, event):
|
||||
fields = {}
|
||||
fields["filename"] = self.filename
|
||||
fields["build_name"] = event.get("name", "UNKNOWN")
|
||||
fields["build_status"] = event["build"].get("status", "UNKNOWN")
|
||||
fields["build_number"] = event["build"].get("number", "UNKNOWN")
|
||||
|
@ -32,6 +32,7 @@ filter {
|
||||
negate => true
|
||||
pattern => "^%{DATESTAMP} \|"
|
||||
what => "previous"
|
||||
stream_identity => "%{@source_host}.%{filename}"
|
||||
}
|
||||
multiline {
|
||||
type => "jenkins"
|
||||
@ -39,6 +40,7 @@ filter {
|
||||
negate => true
|
||||
pattern => "^%{DATESTAMP} "
|
||||
what => "previous"
|
||||
stream_identity => "%{@source_host}.%{filename}"
|
||||
}
|
||||
grok {
|
||||
type => "jenkins"
|
||||
|
Loading…
Reference in New Issue
Block a user