@tej57 Here is the code, I reused the template that the addon builder app started. The data input is also setup, it was built by the app, I have to give it a name and put the interval to 30 seconds. Formatting here is not good.... # encoding = utf-8 import os import sys import time import datetime ''' IMPORTANT Edit only the validate_input and collect_events functions. Do not edit any other part in this file. This file is generated only once when creating the modular input. ''' ''' # For advanced users, if you want to create single instance mod input, uncomment this method. def use_single_instance_mode(): return True ''' def validate_input(helper, definition): """Implement your own validation logic to validate the input stanza configurations""" # This example accesses the modular input variable # password = definition.parameters.get('password', None) # username = definition.parameters.get('username', None) # finesse_ip = definition.parameters.get('finesse_ip', None) pass def collect_events(helper, ew): import requests from requests.auth import HTTPBasicAuth finesse_ip = helper.get_arg('finesse_ip') username = helper.get_arg('username') password = helper.get_arg('password') url = f"https://{finesse_ip}/finesse/api/SystemInfo" try: response = requests.get(url, auth=HTTPBasicAuth(username, password), verify=False) if response.status_code == 200: helper.log_info(f"Successfully retrieved data from {url}") else: helper.log_error(f"Request failed. Status: {response.status_code}, Body: {response.text}") event = helper.new_event( data=response.text, source=helper.get_input_type(), index=helper.get_output_index(), host="finesse1a", sourcetype=helper.get_sourcetype() ) ew.write_event(event) except Exception as e: helper.log_error(f"Error during request to {url}: {str(e)}")
... View more