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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...