Preconfigured connectors and action types

edit

Preconfigured connectors and action types

edit

You can preconfigure a connector or action type to have all the information it needs prior to startup by adding it to the kibana.yml file.

Preconfigured connectors offer the following capabilities:

  • Require no setup. Configuration and credentials needed to execute an action are predefined, including the connector name and ID.
  • Appear in all spaces because they are not saved objects.
  • Cannot be edited or deleted.

A preconfigured action type has only preconfigured connectors. Preconfigured connectors can belong to either the preconfigured action type or to the regular action type.

Preconfigured connectors

edit

This example shows a valid configuration for two out-of-the box connectors: Slack and Webhook.

  xpack.actions.preconfigured:
    my-slack1:                  
      actionTypeId: .slack      
      name: 'Slack #xyz'        
      secrets:
        webhookUrl: 'https://hooks.slack.com/services/abcd/efgh/ijklmnopqrstuvwxyz'
    webhook-service:
      actionTypeId: .webhook
      name: 'Email service'
      config:                   
        url: 'https://email-alert-service.elastic.co'
        method: post
        headers:
          header1: value1
          header2: value2
      secrets:                  
        user: elastic
        password: changeme

The key is the action connector identifier, my-slack1 in this example.

actionTypeId is the action type identifier.

name is the name of the preconfigured connector.

config is the action type specific to the configuration.

secrets is sensitive configuration, such as username, password, and keys.

Sensitive properties, such as passwords, can also be stored in the Kibana keystore.

When you open the menu, then go to Stack Management > Kibana > Alerts and Actions, preconfigured connectors appear on the Connectors tab, regardless of which space you are in. They are tagged as “preconfigured”, and you cannot delete them.

Connectors managing tab with pre-cofigured

Clicking a preconfigured connector shows the description, but not the configuration. A message indicates that this is a preconfigured connector.

Pre-configured connector view details

The connector details preview is disabled for preconfigured connectors of a preconfigured action type.

Connectors managing tab with pre-cofigured

Preconfigured action type

edit

This example shows a preconfigured action type with one out-of-the box connector.

  xpack.actions.enabledActionTypes: ['.slack', '.email', '.index'] 
  xpack.actions.preconfigured:                                     
    my-server-log:
      actionTypeId: .server-log
      name: 'Server log #xyz'

enabledActionTypes excludes the preconfigured action type to prevent creating and deleting connectors.

preconfigured is the setting for defining the list of available connectors for the preconfigured action type.

To attach a preconfigured action to an alert:

  1. Open the menu, then go to Stack Management > Kibana > Alerts and Actions, open the Connectors tab.
  2. Click Create connector.
  3. In the list of available action types, select the preconfigured action type you want.

    Pre-configured connector create menu
  4. In Create alert, open the connector dropdown, and then select the preconfigured connector.

    The preconfigured label distinguishes it from a space-aware connector.

    Dropdown list with pre-cofigured connectors
  5. Click Add action.