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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...