How to use the Splunk SDK for Java

This section shows how to do the basics with the Splunk SDK for Java and Splunk Enterprise. We're assuming you already followed the instructions in the Getting Started section and were able to run the examples. We're also assuming you know your way around Splunk Web and got your feet wet—you've added some data and saved a search or two. If so, you're ready to start using the SDK to develop Splunk Enterprise applications.

If you try the examples that are included with the SDK, you'll notice that they are all written from a command-line perspective. That is, they start by parsing the parameters that are provided at the command line and the parameters that are defined in the .splunkrc file (the optional file that stores your login credentials for convenience when running the SDK examples, described in Utilities).

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. If you want more advanced real-world examples, see the Java code examples on GitHub.

We use our own and third-party cookies to provide you with a great online experience. We also use these cookies to improve our products and services, support our marketing campaigns, and advertise to you on our website and other websites. Some cookies may continue to collect information after you have left our website.
Learn more (including how to update your settings) here »