Skip to content

Commit

Permalink
Use the very nice null-safe operators to shorten if clauses
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathieu Martin committed Jan 10, 2019
1 parent b7592a6 commit dfd5670
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions filebeat/module/kibana/log/ingest/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
},
{
Expand Down Expand Up @@ -108,7 +108,7 @@
"set": {
"field": "source.ip",
"value": "{{source.address}}",
"if": "ctx.containsKey('source') && ctx.source.containsKey('address')"
"if": "ctx.source?.address != null"
}
},
{
Expand Down

0 comments on commit dfd5670

Please sign in to comment.