Class SplunkCimLogEvent

java.lang.Object
com.splunk.logging.SplunkCimLogEvent

public class SplunkCimLogEvent
extends Object
SplunkCimLogEvent encapsulates the best practice logging semantics recommended by Splunk. It produces events of key, value pairs, properly formatted and quoted for logging with any of Java's standard logging libraries (logback, log4j, java.util.logging, etc.) and indexing by Splunk. The class has convenience methods to set the fields defined in the standard Splunk Common Information Model. SplunkCimLogEvent adds no timestamp to its fields, leaving you free to configure whatever timestamp format you prefer in your logging configuration. Logger logger = LoggerFactory.getLogger("splunk.logger"); SplunkCimLogEvent event = new SplunkCimLogEvent("Failed Login", "sshd:failure"); event.setAuthApp("jane"); event.setAuthUser("jane"); event.addField("somefieldname", "foobar"); logger.info(event.toString());
See Also:
Splunk CIM, Splunk Logging Best Practices