Splunk Search

Sending data from splunk to non splunk server

disha
Contributor

I need to run the search query on splunk like
sourcetype="agent"|spath path="EID" output="EventID"|search EventID=3|table *
I am getting 5 fields for EventID=3. I need to send the values of all five fields over some time range to non splunk server as csv file.
Right now I am using java for socket communication and Java SDK to interact with splunk.This is my approach. Today I was reading something about forwarders.
My question is :
1. Can forwarders do the same thing for me?
2. for accomplish my requirement, Using forwarders is better approach than socket communication or I am just getting confused?
3. If No.What kind of forwarder I can use for this.
Thanks,
Disha

Tags (1)
0 Karma
1 Solution

rgcurry
Contributor

No, it cannot. Have you looked into having this search fire an alert that would run a script to send the csv file to the other server? At my previous Splunk Admin engagement, this was done using smttrapd as the sender. A script could use your java solution -- which in itself is not a 'bad' thing. You are going to need some form of socket communication between the Splunk and non-Splunk server.

Look here for info about creating an alert that runs a script: http://docs.splunk.com/Documentation/Splunk/5.0.1/Alert/Setupalertactions#Run_a_script

View solution in original post

0 Karma

disha
Contributor

Thanks for clearing my doubt.Socket communication is the better choice if we want to extend the functionality or service from splunk.Thanks

0 Karma

rgcurry
Contributor

No, it cannot. Have you looked into having this search fire an alert that would run a script to send the csv file to the other server? At my previous Splunk Admin engagement, this was done using smttrapd as the sender. A script could use your java solution -- which in itself is not a 'bad' thing. You are going to need some form of socket communication between the Splunk and non-Splunk server.

Look here for info about creating an alert that runs a script: http://docs.splunk.com/Documentation/Splunk/5.0.1/Alert/Setupalertactions#Run_a_script

0 Karma

disha
Contributor

Thank for the reply.I read this doc. My question is I am not able to decide that universal forwarder can do the stuff for which I am using socket communication as My requirement is just to query the data and sending the result to non splunk server. Doc tell me how to execute if you choose this approch. I want to know that Should I go with this approch.

0 Karma

Ayn
Legend

When you say that you've read "something" about forwarders, what have you been reading? Because the docs explain what a forwarder is and does pretty well: http://docs.splunk.com/Documentation/Splunk/latest/Deploy/Introducingtheuniversalforwarder

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...