All Apps and Add-ons

Connection refused when I connect Jenkins with Splunk

New Member

i'm trying to connect Jenkins with Splunk Enterprise (I have a student license), I'm using the Splunk plugin in Jenkins, unfortunately, when I press the "Test connection" button, it tells me connection refused.
I have locally installed Splunk on Ubuntu and i run Jenkins from Docker.
In Splunk I created a HEC for Jenkins, the HEC is correctly enabled.
I tried this command on terminal: curl -k https://localhost:8088/services/collector/event -H "Authorization: Splunk mytoken" -d '{"event": "hello world"}' and the response is {"text": "Success", "code": 0} .
But when i try to connect from Jenkins the response is "connection refused".
I tried Splunk cloud trial for 15 days and using cloud url Jenkins was connecting properly. With local Splunk I can't get it connected.
Can someone please help me?

Tags (1)
0 Karma

New Member

Since Jenkins is running in a docker container, in Splunk for Jenkins Configuration, you have to give - HTTP Input Host as 'host.docker.internal' and NOT as 'localhost'

If you specify localhost, then jenkins docker container will try connecting to 8088 on the same container, for which it will get 'Connection Refused'. Whereas host.docker.internal refers to the Host machine on which both Jenkins container and Splunk are running, Hence Jenkins will be able to connect to Splunk on 8088

0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In the last month, the Splunk Threat Research Team (STRT) has had 2 releases of new security content via the ...

Announcing the 1st Round Champion’s Tribute Winners of the Great Resilience Quest

We are happy to announce the 20 lucky questers who are selected to be the first round of Champion's Tribute ...

We’ve Got Education Validation!

Are you feeling it? All the career-boosting benefits of up-skilling with Splunk? It’s not just a feeling, it's ...