Hello Splunk Community,
I am trying to trace a Python FastAPI RAG API running on my local PC to my Splunk Cloud instance using the HTTP Event Collector (HEC). I am facing persistent issues with DNS resolution for the HEC endpoint hostname.
My application is a Python FastAPI service. I manage environment variables via a `.env` file, which is loaded at application startup. My tracing logic is implemented in a custom `tracing_helper.py` module, which attempts to connect to the HEC endpoint using the configured environment variables.
Despite configuring the HEC token and settings in Splunk Cloud, my application and direct `curl` commands consistently fail to connect to the HEC endpoint when using the hostname, resulting in `NameResolutionError` (or `[Errno 8] nodename nor servname provided, or not known`).
I have tried various `SPLUNK_HEC_URL` formats in my `.env` file, including:
My application's logs repeatedly show:
DNS Resolution Error: [Errno 8] nodename nor servname provided, or not known Unable to resolve Splunk Cloud HEC hostname. Check network configuration. HTTPSConnectionPool(host='http-inputs-prd-p-gu5st.splunkcloud.com', port=443): Max retries exceeded with url: /services/collector (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x...>: Failed to resolve 'http-inputs-prd-p-gu5st.splunkcloud.com' ([Errno 8] nodename nor servname provided, or not known)"))
I have also performed network-level troubleshooting from my local machine:
Any guidance or suggestions would be greatly appreciated.
Thank you!
Splunk Cloud Trial instances are slightly different in configuration to production instances and have various restrictions.
Ultimately for a trial stack you need to use https://<stack>.splunkcloud.com:8088/services/collector/health
For your stack this would be: https://prd-p-gu5st.splunkcloud.com:8088/services/collector
We can confirm HEC is running and accessible by visiting: https://prd-p-gu5st.splunkcloud.com:8088/services/collector/health
Note however that there is no trusted SSL Cert on 8088 when accessing on a Splunk Trial stack, in production stacks this is done via a Load Balancer with a valid trusted public certificate.
For your trial instance you will need to accept/allow a non-trusted certificate by setting verify=false in your code.
🌟 Did this answer help you? If so, please consider:
Your feedback encourages the volunteers in this community to continue contributing
In relation to your other questions:
🌟 Did this answer help you? If so, please consider:
Your feedback encourages the volunteers in this community to continue contributing
Splunk Cloud Trial instances are slightly different in configuration to production instances and have various restrictions.
Ultimately for a trial stack you need to use https://<stack>.splunkcloud.com:8088/services/collector/health
For your stack this would be: https://prd-p-gu5st.splunkcloud.com:8088/services/collector
We can confirm HEC is running and accessible by visiting: https://prd-p-gu5st.splunkcloud.com:8088/services/collector/health
Note however that there is no trusted SSL Cert on 8088 when accessing on a Splunk Trial stack, in production stacks this is done via a Load Balancer with a valid trusted public certificate.
For your trial instance you will need to accept/allow a non-trusted certificate by setting verify=false in your code.
🌟 Did this answer help you? If so, please consider:
Your feedback encourages the volunteers in this community to continue contributing
But the address http-inputs-prd-p-gu5st.splunkcloud.com doesn't resolve to an IP address indeed.
So it is not a proper address for the stack.
BTW, the trial stack uses a self-signed cert on HEC input or doesn't use TLS at all? I don't remember.
Thats right, the trial stacks run as a single instance without a load balancer infront of them I believe, therefore you access via the stack name on port 8088 without the http-input prefix.
SSL is enabled on HEC but because it doesnt have a trusted cert (it uses the default Splunk cert on the server).