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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...