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!

What's New in Splunk Cloud Platform 9.2.2403?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.2.2403! Analysts can ...

Stay Connected: Your Guide to July and August Tech Talks, Office Hours, and Webinars!

Dive into our sizzling summer lineup for July and August Community Office Hours and Tech Talks. Scroll down to ...

Edge Processor Scaling, Energy & Manufacturing Use Cases, and More New Articles on ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...