From 24d3f113260e6e64422dc20bf5e60d8482181544 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Tue, 9 Apr 2013 11:48:55 -0700 Subject: [PATCH] Clean up logstash Jenkins console logs. * modules/openstack_project/files/logstash/log-pusher.py: Change @message to event_messsage. Using @message here appears to confuse logstash and results in duplicate events. * modules/openstack_project/templates/logstash/agent.conf.erb: Change @message to event_messsage. Using @message here appears to confuse logstash and results in duplicate events. Also drop the opening and closing pre tags that end up in the html log files. Change-Id: I3cf679dc644392cfb8ef9002cf149d8b449ad4f5 Reviewed-on: https://review.openstack.org/26518 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins --- agent.conf.erb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/agent.conf.erb b/agent.conf.erb index 6a13b0f..7bf8246 100644 --- a/agent.conf.erb +++ b/agent.conf.erb @@ -2,7 +2,7 @@ input { pipe { command => "python3 /usr/local/bin/log-pusher.py -r -z tcp://jenkins.openstack.org:8888 -l http://logs.openstack.org -f console.html" format => "json" - message_format => "%{@message}" + message_format => "%{event_message}" tags => ["jenkins", "console"] type => "jenkins_console" } @@ -10,6 +10,12 @@ input { # You can check grok patterns at http://grokdebug.herokuapp.com/ filter { + grep { + type => "jenkins_console" + # Drop matches. + negate => true + match => ["@message", "^$"] + } grok { type => "jenkins_console" pattern => [ "%{DATESTAMP:logdate} \| %{GREEDYDATA:logmessage}" ]