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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

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 ...