From dfd5670ec2996188996d365aca9e7131d78d00bb Mon Sep 17 00:00:00 2001 From: Mathieu Martin Date: Thu, 10 Jan 2019 13:46:00 -0500 Subject: [PATCH] Use the very nice null-safe operators to shorten `if` clauses --- filebeat/module/kibana/log/ingest/pipeline.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/filebeat/module/kibana/log/ingest/pipeline.json b/filebeat/module/kibana/log/ingest/pipeline.json index 5ede04d9dc8..0822a0624c4 100755 --- a/filebeat/module/kibana/log/ingest/pipeline.json +++ b/filebeat/module/kibana/log/ingest/pipeline.json @@ -58,7 +58,7 @@ "lang": "painless", "source": "ctx.event.duration = Math.round(ctx.kibana.log.meta.res.responseTime * params.scale)", "params": { "scale": 1000000 }, - "if": "ctx.kibana.log.containsKey('meta') && ctx.kibana.log.meta.containsKey('res') && ctx.kibana.log.meta.res.containsKey('responseTime')" + "if": "ctx.kibana.log.meta?.res?.responseTime != null" } }, { @@ -108,7 +108,7 @@ "set": { "field": "source.ip", "value": "{{source.address}}", - "if": "ctx.containsKey('source') && ctx.source.containsKey('address')" + "if": "ctx.source?.address != null" } }, {