Exam SPLK-1003 All QuestionsBrowse all questions from this exam
Question 147

What is the correct curl to send multiple events through HTTP Event Collector?

    Correct Answer: B

    To send multiple events through the HTTP Event Collector (HEC) in Splunk using curl, you need to ensure each event is enclosed in its own JSON object and separated by spaces. The correct syntax would allow multiple JSON payloads to be sent in a single request. Option B correctly shows multiple events by expressing each event in its own JSON object, separated by a space. This is the proper way to form the curl command for sending multiple events to the HEC in Splunk. The other options either improperly format the JSON data or do not separate the events correctly.

Discussion
shesky17Option: B

B. curl "https://mysplunkserver.example.com:8088/services/collector" \ -H "Authorization: Splunk DF469ZE4-3G38-65F5-H708-6284GG91PF67" \ -d '{"event": "Hello World"}{"event": "Hola Mundo"}{"event": "Hallo Welt", "nested": {"key1": "value1"}}' See: https://docs.splunk.com/Documentation/Splunk/9.2.1/Data/HECExamples#:~:text=world!%22%2C%20%22sourcetype%22%3A%20%22manual%22%7D%27-,Example%202%3A%20Send%20multiple%20events%20to%20HEC,-This%20example%20demonstrates curl "https://mysplunkserver.example.com:8088/services/collector" \ -H "Authorization: Splunk CF179AE4-3C99-45F5-A7CC-3284AA91CF67" \ -d '{"event": "Pony 1 has left the barn"}{"event": "Pony 2 has left the barn"}{"event": "Pony 3 has left the barn", "nested": {"key1": "value1"}}'

MartinCaplanOption: C

C suppose to be : To send multiple events through HTTP Event Collector (HEC) using cURL, you would typically use a command similar to the following: bash Copy code curl -k $SPLUNK_HEC_URL \ -H "Authorization: Splunk $SPLUNK_HEC_TOKEN" \ -d '{"event": "your_event_data1", "sourcetype": "your_sourcetype1", "source": "your_source1"}' \ -d '{"event": "your_event_data2", "sourcetype": "your_sourcetype2", "source": "your_source2"}' Replace $SPLUNK_HEC_URL with your HEC endpoint URL and $SPLUNK_HEC_TOKEN with your HEC token. This example sends two events, each specified with -d option containing JSON data. Adjust the event, sourcetype, and source fields as needed for your events. You can continue adding -d options for additional events. Make sure each JSON data object is separated by a space.