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!

Cloud Platform | Customer Change Announcement: Email Notification Will Be Available ...

The Notification Team is migrating our email service provider since currently there’s no support ...

Mastering Synthetic Browser Testing: Pro Tips to Keep Your Web App Running Smoothly

To start, if you're new to synthetic monitoring, I recommend exploring this synthetic monitoring overview. In ...

Splunk Edge Processor | Popular Use Cases to Get Started with Edge Processor

Splunk Edge Processor offers more efficient, flexible data transformation – helping you reduce noise, control ...