Developing for Splunk Enterprise
Highlighted

Data extracted from splunk and use it in java form

Explorer

I have extracted certain feilds using java sdk from splunk with the table command.
The data extracted is in the form of job. How can i convert that data into string, so that i can apply conditional operators on that data.

Thanks in advance for your help.

0 Karma
Highlighted

Re: Data extracted from splunk and use it in java form

Influencer

Fortunately for you it is well documented on how to iterate over the events once you have a job. You are likely looking for:

http://dev.splunk.com/view/java-sdk/SP-CAAAEHQ - "How to work with searches and jobs using the Splunk SDK for Java" which links to:
http://dev.splunk.com/view/java-sdk/SP-CAAAEPZ - "How to display search results using the Splunk SDK for Java"

Of course you wouldn't use as much System.out.println, but you get the idea. If Javadoc is more your thing: http://docs.splunk.com/DocumentationStatic/JavaSDK/1.5.0/index.html

Now one other thing you say that you want to "apply conditional operators on that data" I wonder if you might be interested in the eval or where search commands by which you can add to your search and let Splunk do more work leveraging eval functions instead of building custom code?

View solution in original post

0 Karma
Highlighted

Re: Data extracted from splunk and use it in java form

Explorer

Yeh i have used the above stated documents to extract the data from splunk and its working fine. But i need to convert that data into string to use it at the front end part and no i can't use eval functions as i need to build a custom code. Kindly help me with that.

0 Karma