Closed FreezeLuiz closed 1 year ago
Filtering on the instance type fixed the issue.
import results
response = ... # the body of an HTTP response
reader = results.JSONResultsReader(response)
for result in reader:
if isinstance(result, dict):
print "Result: %s" % result
elif isinstance(result, results.Message):
print "Message: %s" % result
print "is_preview = %s " % reader.is_preview
Describe the bug While extracting results from a saved Splunk search that leverages an appended 'inputlookup.' I get an error saying 'Message' object is not subscriptable. The issue resides in the 'Message' object being displayed first as an informational message (e.g: INFO: [subsearch]: Successfully read lookup file) from Splunklib.results, which makes the return value from splunklib.results.JSONResultsReader not subscriptable.
To Reproduce Steps to reproduce the behavior:
Expected behavior Informational messages should only be displayed when a debugging flag is active, debugging flags should be disabled by default.
Logs or Screenshots
SDK:
Additional Context