Getting Data In

Send JSON file/txt file using HEC - stuck on curl command

spharisha
New Member

Hello

Trying to send a JSON file/text file through HEC to splunk. Getting stuck while adding

"-d @data.json" in curl command. I have created a new token, enabled it, sent sample data like Hello world, and works. But, not sure how to send txt/json file using curl

Thanks
SP

0 Karma

PowerPacked
Builder

Hi @spharisha

I think you are trying to send the whole file using curl command,

& i feel like you should consider it by configuring inputs and send it to HEC index on indexer.

Thanks

0 Karma

yannK
Splunk Employee
Splunk Employee

example :

   curl -k https:/myserver:8088/services/collector/event -H 'Authorization: Splunk 0a211f9a-1a27-471b-b0e0-5a5bd2d9a88c' -d '{"event": "hello world"}'
0 Karma
Get Updates on the Splunk Community!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...