Getting Data In

How can I push a comma separated line of fields to Splunk using the Java SDK?

rbkaspr
New Member

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.

Tags (4)
0 Karma

woodcock
Esteemed Legend
0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...