All Apps and Add-ons

Connection refused when I connect Jenkins with Splunk

antoniocapizzi
New Member

Hi,
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

sundaybunch
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!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...