Agent healthy but not sending logs

I installed Elasticsearch on a server and Fleet on the same server,
we I tried to install the agent to a server with the same subnet using a private IP it worked fine, but when I installed the agent to another server using the elastic public IP it showed agent health and enrolled successfully to fleet but did not send any logs I tried with many other server and same case.

Is the Elasticsearch output host accessible from the agent?
You can investigate more if you look at the agent logs.

I have looked at the agent logs and tried one of the Windows machine with Wireshark and no errors appear that would help
and the output host which is IP:9200 is accessible yes by the Agent