Splunk Dev

HTTPS collector not receiving items from scrape?

kristjobnext
New Member

Using Splunk enterprise. https://45.55.161.5:8000/en-US/app/launcher/home

A HTTPS event collector is listening on 8088 with token DB84F19F-B2F1-4B89-BB38-643DFB641B34

From source, this code is trying to send JSON to Spunk. But Splunk does not receive. Can anyone help to get this right?

Thanks

import requests
import json

url = 'http://45.55.161.5:8088/services/collector/event'
payload = {
"Test": "Splunk ",
}
headers = {
"Authorization": "Splunk DB84F19F-B2F1-4B89-BB38-643DFB641B34",
}
r = requests.post(url, data=json.dumps(payload), headers=headers)
print(r.content)

Tags (1)
0 Karma

starcher
Influencer

You could just use a premade HEC python class.
https://github.com/georgestarcher/Splunk-Class-httpevent

But make sure your token is valid in the permissions for the destination index you are wanting to send to.

0 Karma

kristjobnext
New Member

Thanks Starcher. I will check this out and let you know.

0 Karma

kristjobnext
New Member

btw, it doesn't work with https neither. 'https://45.55.161.5:8088/services/collector/event'

0 Karma
Get Updates on the Splunk Community!

What's New in Splunk Observability - October 2025

What’s New?    We’re excited to announce the latest enhancements to Splunk Observability Cloud and share ...

🌟 From Audit Chaos to Clarity: Welcoming Audit Trail v2

🗣 You Spoke, We Listened  Audit Trail v2 wasn’t written in isolation—it was shaped by your voices.  In ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

 Prepare to elevate your security operations with the powerful upgrade to Splunk Enterprise Security 8.x! This ...