{% if item.udp_port | d() %}
# Log messages from remote hosts over UDP
input(name="{{ item.name }}" type="imudp" port="{{ item.udp_port | d(__rsyslog_default_port) }}")
{% elif item.tcp_port | d() %}
# Log messages from remote hosts over plain TCP
input(name="{{ item.name }}" type="imptcp" port="{{ item.tcp_port | d(__rsyslog_default_port) }}")
{% else %}
# Log messages from remote hosts over TLS
input(name="{{ item.name }}" type="imtcp" port="{{ item.tcp_tls_port | d(__rsyslog_default_tls_port) }}")
{% endif %}
{{ lookup('template', 'input_template.j2') }}
