Reporting

How would I use a job by sid in distributed system

mcraciunescu
New Member

I'm writing a piece of code that actually happens in a distributed system pipeline.

I need to paginate on search result and I can't retrieve all the results in one go (the results may be bigger than the batch_size that the components  can use).

I've managed to use retrieve the old job

by

sid2='1654105815.20373'
old_job = service.job(sid2)

 

However sometime the jobs expires and I do have problems getting the result.

for result in results.JSONResultsReader(old_job.events(**{"count": total_size, "output_mode": "json","offset":800})):

if isinstance(result, results.Message):
print(result)
elif isinstance(result, dict😞
final_res.append(result)

always does not return anything (no values )are present.

Any advice?

0 Karma
Get Updates on the Splunk Community!

Community Content Calendar, November Edition

Welcome to the November edition of our Community Spotlight! Each month, we dive into the Splunk Community to ...

October Community Champions: A Shoutout to Our Contributors!

As October comes to a close, we want to take a moment to celebrate the people who make the Splunk Community ...

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

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...