How to use the Splunk SDK for PHP

The Splunk SDK for PHP is deprecated. For more information, see Deprecation notice.

This section of the Splunk® SDK for PHP shows how to start using Splunk to create your own apps with PHP. Before continuing, be sure you've done the following:

  • Installed and configured Splunk (for more information, see Getting Started)
  • Updated PHP to at least version 5.2.11 (PHP 5.3.7 or later is highly recommended)
  • Installed the Splunk SDK for PHP (simply move the entire /splunk-sdk-php directory to your web server's document root)
  • Checked out and run the examples

We're assuming you know your way around Splunk Web and that you've gotten your feet wet. You've added some data and saved a search or two. (If not, check out the Splunk Tutorial.) Now you're ready to start using the SDK for PHP to develop Splunk apps.

For simplicity, the code examples in this section avoid error handling, command-line processing, and complex logic, staying focused simply on showing you how to use the SDK APIs.

How to...

Introduces the basic process of connecting to splunkd and logging in.

Shows how to list, create, and run saved searches.

Shows how to list search jobs, create new jobs by running different types of searches, and display the results from searches in different formats.