fix: Initial bug fixes #28
@ -43,6 +43,13 @@
|
||||
"subnetId": "{{ subnet.id }}",
|
||||
"ip": "{{ scanned_host.address['@addr'] | default(scanned_host.address[0]['@addr']) }}",
|
||||
"lastSeen": "{{ nmap_scan.start }}",
|
||||
{% if scanned_host.hostnames.hostname is defined %}
|
||||
{% if '.' in scanned_host.hostnames.hostname['@name'] | string %}
|
||||
"hostname": "{{ (scanned_host.hostnames.hostname['@name'] | split('.'))[0] }}",
|
||||
{% else %}
|
||||
"hostname": "{{ scanned_host.hostnames.hostname['@name'] }}",
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if scanned_host.address['@addrtype'] | default(scanned_host.address[1]['@addrtype']) == 'mac' %}
|
||||
"mac": "{{ scanned_host.address['@addr'] | default(scanned_host.address[1]['@addr']) | upper }}"
|
||||
{% endif %}
|
||||
|
Reference in New Issue
Block a user