Splunk Dev

How to debug the sum.py sdk example command from the command line?

hansj
Explorer

Hi,

For debugging I want to run my custom search commands from the command line.

The generatehello.py sdk example command runs fine from the command line and produces the results it should:

$ python generatehello.py __EXECUTE__ count=5 < /dev/null. 

However, I am having trouble running the sum.py command the same way:

python sum.py __EXECUTE__ total=lines linecount < /dev/null
ERROR
"TypeError at ""/home/hansj/dev/splunk-sdk-python-master/splunklib/searchcommands/splunk_csv/dict_reader.py"", line 38 :  'NoneType' object is not iterable"

I guess the sum command requires an event stream, perhaps also for debugging, and if such, how does one go about debugging that?

Thanks,
Hans J.

Tags (4)
0 Karma
1 Solution

hansj
Explorer

Ah, I just found that the python commands reloads every time you do a search, so no need to have the command line example work.

View solution in original post

0 Karma

hansj
Explorer

Ah, I just found that the python commands reloads every time you do a search, so no need to have the command line example work.

0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...