Index action

The index action type will index a document into Elasticsearch. See also the create index API.

Connector configuration

Index connectors have the following configuration properties:

Name

The name of the connector. The name is used to identify a connector in the management UI connector listing, or in the connector list when configuring an action.

Index

The Elasticsearch index to be written to.

Refresh

Setting for the refresh policy for the write request.

Execution time field

This field will be automatically set to the time the alert condition was detected.

Preconfigured action type

  1. my-index:
  2. name: action-type-index
  3. actionTypeId: .index
  4. config:
  5. index: .kibana
  6. refresh: true
  7. executionTimeField: somedate

config defines the action type specific to the configuration and contains the following properties:

index

A string that corresponds to Index.

refresh

A boolean that corresponds to Refresh.

executionTimeField

A string that corresponds to Execution time field.

Action configuration

Index actions have the following properties:

Document

The document to index in JSON format.

Example of the index document for Index Threshold alert:

  1. {
  2. "alert_id": "{{alertId}}",
  3. "alert_name": "{{alertName}}",
  4. "alert_instance_id": "{{alertInstanceId}}",
  5. "context_message": "{{context.message}}"
  6. }

Example of create test index using the API.

  1. PUT test
  2. {
  3. "settings" : {
  4. "number_of_shards" : 1
  5. },
  6. "mappings" : {
  7. "_doc" : {
  8. "properties" : {
  9. "alert_id" : { "type" : "text" },
  10. "alert_name" : { "type" : "text" },
  11. "alert_instance_id" : { "type" : "text" },
  12. "context_message": { "type" : "text" }
  13. }
  14. }
  15. }
  16. }

Most Popular