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!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...