Getting Data In
Highlighted

Re: Add data programatically

Splunk Employee
Splunk Employee

Did you read the code samples that Damien pointed out?

If you still need help with the 404 error, could you provide more information? Keep in mind that the code snippet expects that you have legit service object and you will also need to replace the index name to a valid one from your instance.

0 Karma
Highlighted

Re: Add data programatically

Ultra Champion

As okrabbe states , you can't send a Java Object (binary) direct to Splunk, it must be deserialized into text.

Have a look at https://github.com/damiendallimore/SplunkJavaLogging

As long as your Object has a toString() method implemented, you could use a SplunkJavaLogging appender(log4j, logback) to send the object directly to Splunk.Your toString() method is handling the deserialization.

Some examples here : https://gist.github.com/3263731

Highlighted

Re: Add data programatically

Splunk Employee
Splunk Employee

Damien, great answer. I saved the github link for future reference.

0 Karma