Splunk Dev

How to get latest job results from C# SDK?

thepainfull
Explorer

Hello,

I've been at this for two days now, getting a bit frustrated.

I want to, given a saved search and the app it comes from, get the latest job result. I can do that with the API fairly easily by hitting the /servicesNS/[user]/[appname]/saved/searches/[saved search]/history endpoint, and services/search/jobs/[job id]/results after that.
Now I would like to do the same using the C# SDK (inside a .NET project). All I've been able to do so far is to get the list of apps :

var service = new Service (new Uri([my splunk url]));
await service.LogOnAsync ([user], [pass]);            
await service.Applications.GetAllAsync();

And a list of jobs :

 await service.Jobs.GetAllAsync();

Now, I have no clue how to go any further. I've tried :

var results = job.GetSearchResultsAsync();

But that only populates the properties of each job in the service.Jobs list.

I have also seen references to a ResultsReader class for both the java and python SDK's, but nothing for the C# one.

Am I missing something obvious ? Not obvious ? Is it even possible ?

Thank you in advance for your help.

Labels (2)
0 Karma
1 Solution

thepainfull
Explorer

(If anyone looks for this in the future, I've concluded that as of yet the C#SDK isn't feature complete and I've gone back to using the API directly)

View solution in original post

0 Karma

thepainfull
Explorer

(If anyone looks for this in the future, I've concluded that as of yet the C#SDK isn't feature complete and I've gone back to using the API directly)

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...