From 58d59c6844116d928d4a8e36ff23c34523d93c4e Mon Sep 17 00:00:00 2001 From: Doug Burks Date: Fri, 15 May 2020 14:58:21 -0400 Subject: [PATCH] use null safe operator for source.port and destination.port https://github.com/Security-Onion-Solutions/securityonion-saltstack/issues/594 --- salt/elasticsearch/files/ingest/zeek.common | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/salt/elasticsearch/files/ingest/zeek.common b/salt/elasticsearch/files/ingest/zeek.common index 480359335..c31625db6 100644 --- a/salt/elasticsearch/files/ingest/zeek.common +++ b/salt/elasticsearch/files/ingest/zeek.common @@ -12,9 +12,9 @@ { "rename": { "field": "message2.id.resp_h", "target_field": "destination.ip", "ignore_missing": true } }, { "rename": { "field": "message2.id.resp_p", "target_field": "destination.port", "ignore_missing": true } }, { "set": { "field": "client.ip", "value": "{{source.ip}}" } }, - { "set": { "if": "ctx.source.port != null", "field": "client.port", "value": "{{source.port}}" } }, + { "set": { "if": "ctx.source?.port != null", "field": "client.port", "value": "{{source.port}}" } }, { "set": { "field": "server.ip", "value": "{{destination.ip}}" } }, - { "set": { "if": "ctx.destination.port != null", "field": "server.port", "value": "{{destination.port}}" } }, + { "set": { "if": "ctx.destination?.port != null", "field": "server.port", "value": "{{destination.port}}" } }, { "set": { "field": "observer.name", "value": "{{agent.name}}" } }, { "date": { "field": "message2.ts", "target_field": "@timestamp", "formats": ["ISO8601", "UNIX"], "ignore_failure": true } }, { "remove": { "field": ["agent"], "ignore_failure": true } },