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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

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