summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrysiak Adam <adam.krysiak@nokia.com>2018-12-20 15:33:52 +0100
committerKrysiak Adam <adam.krysiak@nokia.com>2018-12-20 15:34:52 +0100
commit01e2b9be882cb7cc6b419affb8410ad60577c169 (patch)
tree88690ab85705e22c0185929b90617aa5664d0f8d
parent3328d4f819471637c738eb0689d19780f8cfa324 (diff)
Fix error tag condition
Compared status code to integer instead of string Issue-ID: CLAMP-256 Change-Id: I88536238f3058574c6971df8ab9bd963ea20dad7 Signed-off-by: Krysiak Adam <adam.krysiak@nokia.com>
-rw-r--r--kubernetes/clamp/charts/clamp-dash-logstash/resources/config/pipeline.conf35
1 files changed, 24 insertions, 11 deletions
diff --git a/kubernetes/clamp/charts/clamp-dash-logstash/resources/config/pipeline.conf b/kubernetes/clamp/charts/clamp-dash-logstash/resources/config/pipeline.conf
index 317b428c77..78ca65a3c2 100644
--- a/kubernetes/clamp/charts/clamp-dash-logstash/resources/config/pipeline.conf
+++ b/kubernetes/clamp/charts/clamp-dash-logstash/resources/config/pipeline.conf
@@ -57,13 +57,13 @@ filter {
drop { }
}
- if [http_request_failure] or [@metadata][code] != "200" {
+ if [http_request_failure] or [@metadata][code] != 200 {
mutate {
add_tag => [ "error" ]
}
}
- if "dmaap_source" in [tags] {
+ if "dmaap_source" in [@metadata][request][tags] {
#
# Dmaap provides a json list, whose items are Strings containing the event
# provided to Dmaap, which itself is an escaped json.
@@ -76,13 +76,26 @@ filter {
source => "[message]"
target => "message"
}
- ruby {
- code => "
- for ev in event.get('message', [])
- ev.set('@metadata', event.get('@metadata'))
- end
- "
- }
+# ruby {
+# code => '
+# require "json"
+# puts "\n======================================= MESSAGE"
+# print event.get("message")
+# puts "\n======================================= METADATA"
+# print event.get("@metadata")
+# puts ""
+#
+#
+# for ev in event.get("message")
+# puts "\n======================================= PARSED JSON EV"
+# print JSON.parse(ev)
+# puts "\n======================================= JSON EV"
+# print JSON.parse(ev).get("@metadata")
+# puts ""
+# ev.set("[@metadata]", event.get("@metadata"))
+# end
+# '
+ # }
split {
field => "message"
@@ -194,7 +207,7 @@ filter {
}
- if "error" not in [tags] {
+ if "error" not in [@metadata][request][tags]{
#
# Creating data for a secondary index
#
@@ -203,7 +216,7 @@ filter {
add_tag => [ "event-cl-aggs" ]
}
- if "event-cl-aggs" in [tags] {
+ if "event-cl-aggs" in [@metadata][request][tags]{
#
# we only need a few fields for aggregations; remove all fields from clone except :
# vmName,vnfName,vnfType,requestID,closedLoopAlarmStart, closedLoopControlName,closedLoopAlarmEnd,abated,nbrDmaapevents,finalFailure