splunk / docker-splunk

Splunk Docker GitHub Repository
462 stars 253 forks source link

How to find events that were sent to HEC? #625

Open ningziwen opened 1 year ago

ningziwen commented 1 year ago

Hi, I’m using splunk docker image with HEC to send log. I got Success message as the guideline. How could I query the log to see “hello world”, which was what I just sent?I tried a few search related curl commands but all of them just returns a very long xml. “hello world” is not in the response. Such as

curl -k -u admin:1234567Aa! https://localhost:8089/services/search/jobs -d "search *" Could anyways share me a search curl command that can return "hello world" that I sent? I only have one record so I don't need complicated filtering.

Same question in Splunk community: https://community.splunk.com/t5/Splunk-Search/How-to-find-events-that-were-sent-to-HEC/m-p/658181#M227357

craigh1015 commented 4 months ago

The following will work:

curl -k -u 'admin:1234567Aa!' \
-d search="search *" \
-d output_mode=csv \
-d exec_mode=oneshot \
https://localhost:8089/services/search/jobs/export