Skip to content

Commit

Permalink
Add checks to avoid empty strings
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-gr committed Sep 23, 2020
1 parent 5f6afdc commit c39bda1
Show file tree
Hide file tree
Showing 32 changed files with 55 additions and 76 deletions.
2 changes: 1 addition & 1 deletion filebeat/module/osquery/result/ingest/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
"append": {
"field": "related.hosts",
"value": "{{host.hostname}}",
"if": "ctx?.host?.hostname != null",
"if": "ctx?.host?.hostname != null && ctx.host?.hostname != ''",
"allow_duplicates": false
}
}
Expand Down
2 changes: 1 addition & 1 deletion filebeat/module/system/auth/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ processors:
- append:
field: related.hosts
value: "{{host.hostname}}"
if: "ctx.host?.hostname != null"
if: "ctx.host?.hostname != null && ctx.host?.hostname != ''"
allow_duplicates: false
on_failure:
- set:
Expand Down
2 changes: 1 addition & 1 deletion filebeat/module/system/syslog/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ processors:
- append:
field: related.hosts
value: "{{host.hostname}}"
if: "ctx.host?.hostname != null"
if: "ctx.host?.hostname != null && ctx.host?.hostname != ''"
allow_duplicates: false
on_failure:
- set:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ processors:
- append:
field: related.hosts
value: '{{url.domain}}'
if: ctx?.url?.domain != null
if: ctx?.url?.domain != null && ctx?.url?.domain != ""
allow_duplicates: false
- append:
field: related.hosts
value: '{{server.domain}}'
if: ctx?.server?.domain != null
if: ctx?.server?.domain != null && ctx?.url?.domain != ""
allow_duplicates: false
on_failure:
- append:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,6 @@
"observer.product": "Spam",
"observer.type": "Anti-Virus",
"observer.vendor": "Barracuda",
"related.hosts": [
""
],
"related.ip": [
"10.206.159.177"
],
Expand Down Expand Up @@ -1148,9 +1145,6 @@
"observer.product": "Spam",
"observer.type": "Anti-Virus",
"observer.vendor": "Barracuda",
"related.hosts": [
""
],
"related.ip": [
"10.153.108.27"
],
Expand Down Expand Up @@ -1626,9 +1620,6 @@
"observer.product": "Spam",
"observer.type": "Anti-Virus",
"observer.vendor": "Barracuda",
"related.hosts": [
""
],
"related.ip": [
"10.153.152.219"
],
Expand Down Expand Up @@ -1833,9 +1824,6 @@
"observer.product": "Spam",
"observer.type": "Anti-Virus",
"observer.vendor": "Barracuda",
"related.hosts": [
""
],
"related.ip": [
"10.103.69.44"
],
Expand Down Expand Up @@ -1919,9 +1907,6 @@
"observer.product": "Spam",
"observer.type": "Anti-Virus",
"observer.vendor": "Barracuda",
"related.hosts": [
""
],
"related.ip": [
"10.145.193.93"
],
Expand Down Expand Up @@ -2034,9 +2019,6 @@
"observer.product": "Spam",
"observer.type": "Anti-Virus",
"observer.vendor": "Barracuda",
"related.hosts": [
""
],
"related.ip": [
"10.141.225.182"
],
Expand Down Expand Up @@ -2718,9 +2700,6 @@
"observer.product": "Spam",
"observer.type": "Anti-Virus",
"observer.vendor": "Barracuda",
"related.hosts": [
""
],
"related.ip": [
"10.157.196.101"
],
Expand Down Expand Up @@ -3176,8 +3155,8 @@
"observer.type": "Anti-Virus",
"observer.vendor": "Barracuda",
"related.ip": [
"10.178.30.158",
"10.1.6.115"
"10.1.6.115",
"10.178.30.158"
],
"rsa.internal.messageid": "outbound/smtp",
"rsa.investigations.event_cat": 1901000000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ processors:
field: related.hosts
value: '{{host.name}}'
allow_duplicates: false
if: ctx?.host?.name != null
if: ctx?.host?.name != null && ctx.host?.name != ''
on_failure:
- append:
field: error.message
Expand Down
2 changes: 1 addition & 1 deletion x-pack/filebeat/module/cisco/meraki/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ processors:
- append:
field: related.hosts
value: '{{host.hostname}}'
if: ctx.host?.hostname != null
if: ctx.host?.hostname != null && ctx.host?.hostname != ''
allow_duplicates: false
on_failure:
- append:
Expand Down
4 changes: 2 additions & 2 deletions x-pack/filebeat/module/cisco/nexus/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ processors:
- append:
field: related.hosts
value: '{{host.name}}'
if: ctx.host?.name != null
if: ctx.host?.name != null && ctx.host?.name != ''
allow_duplicates: false
- append:
field: related.hosts
value: '{{host.hostname}}'
if: ctx.host?.hostname != null
if: ctx.host?.hostname != null && ctx.host?.hostname != ''
allow_duplicates: false
on_failure:
- append:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1550,22 +1550,22 @@ processors:
- append:
field: related.hosts
value: "{{host.hostname}}"
if: ctx.host?.hostname != null
if: ctx.host?.hostname != null && ctx.host?.hostname != ''
allow_duplicates: false
- append:
field: related.hosts
value: "{{observer.hostname}}"
if: ctx.observer?.hostname != null
if: ctx.observer?.hostname != null && ctx.observer?.hostname != ''
allow_duplicates: false
- append:
field: related.hosts
value: "{{destination.domain}}"
if: ctx.destination?.domain != null
if: ctx.destination?.domain != null && ctx.destination?.domain != ''
allow_duplicates: false
- append:
field: related.hosts
value: "{{source.domain}}"
if: ctx.source?.domain != null
if: ctx.source?.domain != null && ctx.source?.domain != ''
allow_duplicates: false
on_failure:
# Copy any fields under _temp_.cisco to its final destination. Those can help
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ processors:
field: related.hosts
value: '{{server.domain}}'
allow_duplicates: false
if: ctx?.server?.domain != null
if: ctx?.server?.domain != null && ctx.server?.domain != ''
on_failure:
- append:
field: error.message
Expand Down
4 changes: 2 additions & 2 deletions x-pack/filebeat/module/cyberark/corepas/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ processors:
field: related.hosts
value: '{{host.hostname server.domain}}'
allow_duplicates: false
if: ctx?.host?.hostname != null
if: ctx?.host?.hostname != null && ctx.host?.hostname != ''
- append:
field: related.hosts
value: '{{server.domain}}'
allow_duplicates: false
if: ctx?.server?.domain != null
if: ctx?.server?.domain != null && ctx.server?.domain != ''
on_failure:
- append:
field: error.message
Expand Down
2 changes: 1 addition & 1 deletion x-pack/filebeat/module/cylance/protect/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ processors:
field: related.hosts
value: '{{host.name}}'
allow_duplicates: false
if: ctx?.host?.name != null
if: ctx?.host?.name != null && ctx.host?.name != ''
on_failure:
- append:
field: error.message
Expand Down
2 changes: 1 addition & 1 deletion x-pack/filebeat/module/f5/bigipafm/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ processors:
field: related.hosts
value: '{{host.name}}'
allow_duplicates: false
if: ctx?.host?.name != null
if: ctx?.host?.name != null && ctx.host?.name != ''
on_failure:
- append:
field: error.message
Expand Down
2 changes: 1 addition & 1 deletion x-pack/filebeat/module/f5/bigipapm/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ processors:
field: related.hosts
value: '{{rsa.web.fqdn}}'
allow_duplicates: false
if: ctx?.rsa?.web?.fqdn != null
if: ctx?.rsa?.web?.fqdn != null && ctx.rsa?.web?.fqdn != ''
on_failure:
- append:
field: error.message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ processors:
field: related.hosts
value: '{{host.name}}'
allow_duplicates: false
if: ctx?.host?.name != null
if: ctx?.host?.name != null && ctx.host?.name != ''
- append:
field: related.hosts
value: '{{server.domain}}'
allow_duplicates: false
if: ctx?.server?.domain != null
if: ctx?.server?.domain != null && ctx.server?.domain != ''
on_failure:
- append:
field: error.message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ processors:
field: related.hosts
value: '{{server.domain}}'
allow_duplicates: false
if: ctx?.server?.domain != null
if: ctx?.server?.domain != null && ctx.server?.domain != ''
on_failure:
- append:
field: error.message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ processors:
field: related.hosts
value: '{{host.name}}'
allow_duplicates: false
if: ctx?.host?.name != null
if: ctx?.host?.name != null && ctx.host?.name != ''
on_failure:
- append:
field: error.message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ processors:
field: related.hosts
value: '{{host.hostname}}'
allow_duplicates: false
if: ctx?.host?.hostname != null
if: ctx?.host?.hostname != null && ctx.host?.hostname != ''
on_failure:
- append:
field: error.message
Expand Down
4 changes: 2 additions & 2 deletions x-pack/filebeat/module/infoblox/nios/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ processors:
field: related.hosts
value: '{{host.name}}'
allow_duplicates: false
if: ctx?.host?.name != null
if: ctx?.host?.name != null && ctx.host?.name != ''
- append:
field: related.hosts
value: '{{rsa.misc.event_source}}'
allow_duplicates: false
if: ctx?.rsa?.misc?.event_source != null
if: ctx?.rsa?.misc?.event_source != null && ctx.rsa?.misc?.event_source != ''
on_failure:
- append:
field: error.message
Expand Down
4 changes: 2 additions & 2 deletions x-pack/filebeat/module/juniper/junos/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ processors:
field: related.hosts
value: '{{host.hostname}}'
allow_duplicates: false
if: ctx?.host?.hostname
if: ctx?.host?.hostname && ctx.host?.hostname != ''
- append:
field: related.hosts
value: '{{server.domain}}'
allow_duplicates: false
if: ctx?.server?.domain
if: ctx?.server?.domain && ctx.server?.domain != ''
on_failure:
- append:
field: error.message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ processors:
- append:
field: related.hosts
value: '{{host.hostname}}'
if: ctx.host?.hostname != null
if: ctx.host?.hostname != null && ctx.host?.hostname != ''
allow_duplicates: false

#############
Expand Down
4 changes: 2 additions & 2 deletions x-pack/filebeat/module/microsoft/dhcp/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ processors:
field: related.hosts
value: '{{host.hostname}}'
allow_duplicates: false
if: ctx?.host?.hostname != null
if: ctx?.host?.hostname != null && ctx.host?.hostname != ''
- append:
field: related.hosts
value: '{{source.address}}'
allow_duplicates: false
if: ctx?.source?.address != null
if: ctx?.source?.address != null && ctx.source?.address != ''
on_failure:
- append:
field: error.message
Expand Down
2 changes: 1 addition & 1 deletion x-pack/filebeat/module/panw/panos/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ processors:
- append:
field: related.hosts
value: "{{observer.hostname}}"
if: "ctx?.observer?.hostname != null"
if: "ctx?.observer?.hostname != null && ctx.observer?.hostname != ''"
allow_duplicates: false

# Remove temporary fields.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ processors:
field: related.hosts
value: '{{host.name}}'
allow_duplicates: false
if: ctx?.host?.name != null
if: ctx?.host?.name != null && ctx.host?.name != ''
- append:
field: related.hosts
value: '{{destination.address}}'
allow_duplicates: false
if: ctx?.destination?.address != null
if: ctx?.destination?.address != null && ctx.destination?.address != ''
on_failure:
- append:
field: error.message
Expand Down
2 changes: 1 addition & 1 deletion x-pack/filebeat/module/snort/log/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ processors:
field: related.hosts
value: '{{host.name}}'
allow_duplicates: false
if: ctx?.host?.name != null
if: ctx?.host?.name != null && ctx.host?.name != ''
on_failure:
- append:
field: error.message
Expand Down
8 changes: 4 additions & 4 deletions x-pack/filebeat/module/sonicwall/firewall/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,22 @@ processors:
field: related.hosts
value: '{{host.name}}'
allow_duplicates: false
if: ctx?.host?.name != null
if: ctx?.host?.name != null && ctx.host?.name != ''
- append:
field: related.hosts
value: '{{host.hostname}}'
allow_duplicates: false
if: ctx?.host?.hostname != null
if: ctx?.host?.hostname != null && ctx.host?.hostname != ''
- append:
field: related.hosts
value: '{{source.address}}'
allow_duplicates: false
if: ctx?.source?.address != null
if: ctx?.source?.address != null && ctx.source?.address != ''
- append:
field: related.hosts
value: '{{destination.address}}'
allow_duplicates: false
if: ctx?.destination?.address != null
if: ctx?.destination?.address != null && ctx.destination?.address != ''
on_failure:
- append:
field: error.message
Expand Down
Loading

0 comments on commit c39bda1

Please sign in to comment.