How it works...

In this recipe, you executed a Splunk search using the REST API to look for unique page views over the past 7 days. On every Splunk installation, Splunk opens port 8089 by default to listen for REST requests. The requests can be sent using command-line tools such as curl, as seen in our examples, or they can be called using the browser directly.

Splunk supports GET, POST, and DELETE requests. You use a GET request to retrieve or view data, a POST request to update data, and a DELETE request to remove data. Also, results can be returned in various formats, such as XML, JSON, and CSV.

The type of operation you are looking to perform will change the value of the URL you are accessing. In this recipe, you are using an endpoint ...

Get Splunk Operational Intelligence Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.