I have a Java program that reads in a CSV and prints off lines where one field has a certain value, and want to set it up so that the lines are instead sent to a Splunk Light server sitting on localhost. I've managed to manually send data using curl and am looking for a simple example to replicate that functionality using the Java Splunk SDK.
My curl script (fields obfuscated):
curl -k -u admin "localhost:8089/services/receivers/simple?source=www&sourcetype=csv" -d "field1,field2,field3,field4,field5,field6,field7"
Again, is there any way for me to replicate the same functionality of the above curl script in Java? All the tutorials I'm finding have to do with remotely executing searches and contain no useful information about pushing data to the server.
You need the oneshot
command; read about it here:
http://docs.splunk.com/Documentation/Splunk/6.2.4/Data/MonitorfilesanddirectoriesusingtheCLI