Splunk® IT Service Intelligence

Event Analytics Manual

Use the Notable Event Actions SDK

The Notable Events Action SDK comes packaged with ITSI and is located in $SPLUNK_HOME/etc/apps/SA-ITOA/lib/itsi/event_management/sdk. The SDK is implemented in Python and includes:

  • Methods for custom actions on ITSI episodes: class CustomGroupActionBase in custom_group_action_base.py
  • Methods for working on an ITSI episode post-custom action: class EventGroup in grouping.py
  • Methods for finding metadata for ITSI notable events: class EventMeta in eventing.py
  • Methods for finding metadata for ITSI episodes: class GroupMeta in grouping.py

Custom actions require a class that derives from CustomGroupActionBase and implements the execute() method. The __init__() method of your class needs to initialize the base class CustomGroupActionBase.

For more information, see the Notable events action SDK reference.

The following is a summary of the custom action Ping Host that ships with ITSI:

class Ping(CustomGroupActionBase):
    def __init__(self, settings):
        # initialize CustomGroupActionBase
        super(Ping, self).__init__(settings, self.logger)
    def get_host_to_ping(self):
       # from input settings, fetch host to ping
       # some logic is abstracted in custom_event_action_base.py
       return host

    def ping(self, host):
        #does the act of pinging the host
    def execute(self):
        # has all the logic of ping in here...
        host = self.get_host_to_ping()
        std_out, std_err = self.ping(host)
        # do other stuff here, like add a comment to an ITSI episode
        # or add a few tags, and so on....
        # change the state of the episode....
        for data in self.get_group():
            group_id = data.get('itsi_group_id')
            group = EventGroup(self.get_session_key(), self.logger)
            group.create_comment(itsi_group_id, comment)
            group.create_comment(itsi_group_id, out)
            group.create_tag(itsi_group_id, 'ping')

if __name__=='__main__':
    if len(sys.argv) > 1 and sys.argv[1] == '--execute':
        input_params = sys.stdin.read()
        ping = Ping(input_params)

Last modified on 28 April, 2023
Event Analytics Monitoring dashboard   Notable Event Actions SDK reference

This documentation applies to the following versions of Splunk® IT Service Intelligence: 4.11.0, 4.11.1, 4.11.2, 4.11.3, 4.11.4, 4.11.5, 4.11.6, 4.12.0 Cloud only, 4.12.1 Cloud only, 4.12.2 Cloud only, 4.13.0, 4.13.1, 4.13.2, 4.13.3, 4.14.0 Cloud only, 4.14.1 Cloud only, 4.14.2 Cloud only, 4.15.0, 4.15.1, 4.15.2, 4.15.3, 4.16.0 Cloud only, 4.17.0, 4.17.1, 4.18.0, 4.18.1, 4.19.0

Was this topic useful?

You must be logged into splunk.com in order to post comments. Log in now.

Please try to keep this discussion focused on the content covered in this documentation topic. If you have a more general question about Splunk functionality or are experiencing a difficulty with Splunk, consider posting a question to Splunkbase Answers.

0 out of 1000 Characters