Splunk Dev

Java SDK: Why does the JobCollection create method return null?

teresap
Engager

Some backstory:

  • I am writing end-to-end automation for a microservice that writes events to Splunk.
  • I use Java Splunk SDK version 1.6.3.0, which is the latest version stored on our artifactory

When I call create("some query") on a JobCollection object, I often (but not always) get back ‘null’ and I’m not sure what that means or how I should handle it as it's not documented. Does anyone know?

0 Karma

teresap
Engager

Hi @kamlesh_vaghela , I basically do it like this: http://dev.splunk.com/view/java-sdk/SP-CAAAEHQ

// Retrieves the collection of search jobs
JobCollection jobs = service.getJobs();

// Creates a search job
Job job = jobs.create(query);
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@teresap

Can you please share your sample code ?

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 ...