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!

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...