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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...