Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
* Logs an event to Splunk using the receivers/simple endpoint
public static void logEventToSplunkExample() {
Service splunkService = connectAndLoginToSplunkExample();
// Get a Receiver object
Receiver receiver = splunkService.getReceiver();
// Set the sourcetype
Args logArgs = new Args();
logArgs.put("sourcetype", "conf-demo");
// Log a single event into the main index
receiver.log("main", logArgs, "message=\"Splunk Conf 2013, where will your data take you ?\"");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.