ResultsReader iterator error
Using Splunk 6.2.1 and splunk-sdk-python 1.31
the following code throws an exception on the for loop:
resultSet = job.events(**{"offset" : offset, "count" : total})
events = results.ResultsReader(resultSet)
for event in events:
print event["_raw"]
+++++++++++++++++++++++++++++++++++++ Throws exception:
Traceback (most recent call last):
File "monitor.py", line 35, in
++++++++++++++++++++++++++++++++++++++
this is code from a classroom example that has been unchanged for at least a year. not sure if the upgrade of 6.2.0 to 6.2.1 or the new version of the sdk is the problem. the resultSet is verified--ie, the search results from the events() method is valid, contains normal data, etc.
this same error also happens if we let the job finish and then access results from the results() method.
@bobwalden does this still work with the latest 6.2.0?
Also, what version of Python are you using?
I've talked to @bobwalden offline. This is a bug we introduced a while back for Python 2.6.x, we've already fixed it with 867dd46486fa2283a9f6a4c7b750808685dba49f on the develop branch.
confirmed--i was on 2.6.9, updating python to 2.7.9 fixes the problem. should not have let the p-version get so far behind. sorry for the false alarm and thanks Shakeel for the fast support!
Hi @bobwalden we've just released v1.4.0 that addresses this, if you want to revert to Python 2.6.x