You will have to create a custom response handler in vi /opt/splunk/etc/apps/Restta/bin/responsehandler.py, something like this basing on the data you are querying.
class AlarmHandler:
def __init__(self,**args):
pass
def __call__(self, response_object,raw_response_output,response_type,req_args,endpoint):
if response_type == "xml":
import xml.etree.ElementTree as ET
alarm_list = ET.fromstring(encodeXMLText(raw_response_output))
for alarm in alarm_list:
alarm_xml_str = ET.tostring(alarm, encoding='utf8', method='xml')
print_xml_stream(alarm_xml_str)
else:
print_xml_stream(raw_response_output)
... View more