O'Reilly logo

Splunk 7 Essentials - Third Edition by Betsy Page Sigman, Erickson Delgado, J-P Contreras

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Seeing the HEC in action with cURL

Now that the configuration has been quickly completed, let's see how the HEC works. We will use the command line URL method (cURL) to show the HEC in action. We will use the following information to write a cURL command:

  • URL: http://localhost:8088/services/collector
  • Custom Header: Authorization
  • Custom Header Value: Splunk <token>
  • Content Type: application/json
  • Body: { "event": "Mobile Device Event - Something happened" }

cURL is included in macOS X and most Linux distributions, such as CentOS and RHEL, and helps to transfer data to or from a server.

For Windows users, to test the HEC using cURL, download the curl-7.46.0-win64 file available on the book's GitHub site.

From a Linux or macOS command line, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required