How to configure ESXi firewall rule to allow log forwarding to network sensor?

An ESXi firewall configuration on a vSphere client does not allow the creation of a custom port that's rquired to forward logs to a network sensor. Shell access is required to configure a custom port and policy rule. Refer to the VMware KB https://kb.vmware.com/s/article/2008226.