All Apps and Add-ons

REST MODULAR INPUT APP global name 'raw_response_output' is not defined

mnaim
Explorer

Using the REST Modular Input App on my test box, I'm able to get json correctly displayed, but I get a different behavior when I deployed the app. I'm using a 6.0 Heavy Forwarder which forwards to 5.x Indexer. It works fine with the default response handler though. I have my custom response handler correctly showing in inputs.conf.

Looking at the logs, I see this:

"...ERROR ExecProcessor - message from "python /opt/splunkforwarder/etc/apps/rest_ta/bin/rest.py" NameError: global name 'raw_response_output' is not defined..."

My custom forwarder looks like this:

class MyCustomerJSONHandler:

def __init__(self, **args):
    pass

def __call__(self,response_object,raw_response_ouput,response_type,req_args,endpoint):

    if response_type == "json":
        output = json.loads(raw_response_output)
        for result in output["items"]:
            print_xml_stream(json.dumps(result))


    else:
        print_xml_stream(raw_response_output)
0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

There's a typo in your list of arguments, the parameter is declared as raw_response_ouput but used as raw_response_output.

View solution in original post

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

There's a typo in your list of arguments, the parameter is declared as raw_response_ouput but used as raw_response_output.

0 Karma
Get Updates on the Splunk Community!

.conf25 Community Recap

Hello Splunkers, And just like that, .conf25 is in the books! What an incredible few days — full of learning, ...

Splunk App Developers | .conf25 Recap & What’s Next

If you stopped by the Builder Bar at .conf25 this year, thank you! The retro tech beer garden vibes were ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...