From 3b8961beca1d78ee41a90b6baca879e56fc0f267 Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Thu, 27 Sep 2018 15:48:32 -0400 Subject: [PATCH] Fix blank microversion It is possible that OpenStack has no microversion logged which would fail to parse. This fixes that. Change-Id: Ic0d49541b5863d1bdff3138c36d9de6331a7cafa --- elk_metrics_6x/templates/logstash-pipelines.yml.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/elk_metrics_6x/templates/logstash-pipelines.yml.j2 b/elk_metrics_6x/templates/logstash-pipelines.yml.j2 index 80c73101..afeb5296 100644 --- a/elk_metrics_6x/templates/logstash-pipelines.yml.j2 +++ b/elk_metrics_6x/templates/logstash-pipelines.yml.j2 @@ -205,13 +205,13 @@ if [module] == "nova.api.openstack.requestlog" { grok { - match => { "logmessage" => "%{IPORHOST:client_ip} \"%{WORD:verb} %{NOTSPACE:request}\" status\: %{NUMBER:response} len\: %{NUMBER:bytes} microversion\: %{NUMBER:microversion} time\: %{NUMBER:duration:float}" } + match => { "logmessage" => "%{IPORHOST:client_ip} \"%{WORD:verb} %{NOTSPACE:request}\" status\: %{NUMBER:response} len\: %{NUMBER:bytes} microversion\: (%{NUMBER:microversion}|\-) time\: %{NUMBER:duration:float}" } add_tag => ["api"] remove_field => [ "logmessage", "message" ] } } else if [module] == "nova.api.openstack.placement.requestlog" { grok { - match => { "logmessage" => "%{IPORHOST:client_ip} \"%{WORD:verb} %{NOTSPACE:request}\" status\: %{NUMBER:response} len\: %{NUMBER:bytes} microversion\: %{NUMBER:microversion}" } + match => { "logmessage" => "%{IPORHOST:client_ip} \"%{WORD:verb} %{NOTSPACE:request}\" status\: %{NUMBER:response} len\: %{NUMBER:bytes} microversion\: (%{NUMBER:microversion}|\-)" } add_tag => ["api"] remove_field => [ "logmessage", "message" ] }