Splunk Dev

Data extracted from splunk and use it in java form

tankhanandita
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
1 Solution

acharlieh
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

acharlieh
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?

0 Karma

tankhanandita
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
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...