All Apps and Add-ons

How to handle custom parameters in rest modular input

cafissimo
Communicator

Hello,
I have developed a custom response handler class for TA.rest modular input and I would like to pass a custom parameter to it.
I know this is possible, by setting custom parameters in the input configuration page (key1=value, key2=value).
What I can't figure out is how I can access these parameters in my custom class.

class customHandler:

     def __init__(self,**args):
         pass

     def __call__(self, response_object,raw_response_output,response_type,req_args,endpoint):
         if response_type == "json":
             output = json.loads(raw_response_output)
             for record in output["logins"]:
                 print_xml_stream(json.dumps(record))
         else:
             print_xml_stream(raw_response_output)

Any help would be appreciated.
Thanks in advance.

0 Karma
1 Solution

Damien_Dallimor
Ultra Champion
0 Karma

Damien_Dallimor
Ultra Champion

alt text
alt text

0 Karma

cafissimo
Communicator

Thank you very much Damien!

0 Karma

cafissimo
Communicator
0 Karma
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...