Installation

HEC not working for Spunk Cloud

raomu
Explorer

Hello,

I have a test python script below. The script doesn't show-up any error and runs fine but doesn't send any data from TEST.csv file to indexer.

Script:

import csv
import json
import requests

filename="TEST1.csv"
head={"Authorization":"Splunk XXXXXXXXXXXXXXXXXXXXXXXXXXX", "Content-Type": "application/json"}
url="https://dnb.splunkcloud.com:443/services/collector/event"

with open(filename, 'r') as csvfile:
csvreader = csv.DictReader(csvfile)
for row in csvreader:
data={"index": "hcctest", "sourcetype": "devicecollection", "event": row}
r = requests.post(url, data=json.dumps(data), headers=head)

Tags (1)
0 Karma

p_gurav
Champion

Hi,

TEST.csv or TEST1.csv?

0 Karma

raomu
Explorer

thanks for your reply. This issue is fix. We had some issue with the HEC token.

0 Karma
Get Updates on the Splunk Community!

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL  The Splunk AI Assistant for SPL ...

Buttercup Games: Further Dashboarding Techniques (Part 5)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...

Customers Increasingly Choose Splunk for Observability

For the second year in a row, Splunk was recognized as a Leader in the 2024 Gartner® Magic Quadrant™ for ...