====== Elasticsearch Plugin ====== This plugin allows you to send alarms and metrics directly to an Elasticsearch instance Alarm, metrics and Metadata can be indexed in separate Elasticsearch indices ===== Configuration ===== * From the plugin menu of Redpeaks cockpit, press the button ''+ Create'' then select ''Elasticsearch'' in the drop-down. ===== Connection parameters ===== ^ **Parameter** ^ **Description** ^ **Mandatory** ^ | **Active** | Enables or disables the Elasticsearch plugin | Yes | | **Configuration** | Choose between Standard Configuration or Cloud Configuration | Yes | | **Name** | A unique name for the plugin instance | Yes | | **URL** | The URL (with HTTPS for a secure connection) | Yes (if Standard Config selected) | | **Port** | The port used to connect to Elasticsearch (Default is 9200) | Yes (if Standard Config selected) | | **Cloud ID** | The Cloud ID used for connecting to a cloud-based Elasticsearch instance (Cloud Config) | Yes (if Cloud Config selected) | | **API Key** | The API key for authentication (Cloud Config) | Yes (if Cloud Config selected) | | **Username** | The username for Elasticsearch authentication | No | | **Password** | The password for Elasticsearch authentication | No | | **Properties** | A semicolon-separated list of additional Elasticsearch properties | No | **Example:** {{:products:cockpit:1.0:userguide:settings:pasted:20241122-125319.png}} ==== Properties ==== * Properties are key/value pairs separated by semicolon: ''setting1=value1;setting2=value2'' * Common Elasticsearch properties include settings for index refresh intervals, number of replicas, etc. ===== Data configuration ===== * Open Data configuration tab to define how data is going to be sent and indexed in Elastic. ^ Alarms parameters ^^^ ^ **Parameter** ^ **Description** ^ **Mandatory** ^ | **Send alarms** | If active, alarms received by the plugin will be sent to Elasticsearch | No | | **Track alarms history** | If active, enables tracking of alarm history | No | | **Alarm Index** | The Elasticsearch index where alarms will be stored | Yes (if Send alarms checked) | ^ Metrics parameters ^^^ ^ **Parameter** ^ **Description** ^ **Mandatory** ^ | **Send metrics** | If active, metrics received by the plugin will be sent to Elasticsearch | No | | **Track metrics history** | If active, enables tracking of sent metrics | No | | **Metric Index** | The Elasticsearch index where metrics will be stored | Yes (if Send metrics checked) | ^ Metadata parameters ^^^ ^ **Parameter** ^ **Description** ^ **Mandatory** ^ | **Send metadata** | If active, metadata received by the plugin will be sent to Elasticsearch | No | | **Track metadata history** | If active, enables tracking of sent metadata | No | | **Split metadata** | If active, flattens metadata before send it | No | | **Metadata Index** | The Elasticsearch index where metadata will be stored | Yes (if Send metadata checked) | * You can specify different indexes for alarms, metadata and metrics in Elasticsearch. * The data will be indexed according to the configured settings, allowing for efficient search and retrieval. ^ Data queue ^^^ | **Max queue size** | The maximum size of the queue holding alarms and metrics | Yes | **Example:** {{:products:cockpit:1.0:userguide:settings:pasted:20250116-161145.png}} ===== Custom alarm payload ===== * When ''Enable Custom Payload'' is active, you can define a custom payload template for alarms. * This allows you to customize the data sent to Elasticsearch when an alarm is triggered. * You can see more example on [[..:settings:httpplugin|]] | **Enable Custom Payload for Alarms** | If active, allows customization of the alarm payload | No | | **Alarm Payload** | The custom payload template for alarms | Yes (if Custom Payload is enabled) | **Example:** {{:products:cockpit:1.0:userguide:settings:pasted:20241108-174906.png}} ==== Using Custom Payload ===== * **Formatting the Payload** : Use the ''Format'' button to format your payload template. * **Testing the Payload** : Use the ''Test Payload'' button to test your payload with sample data. * **Payload Variable Helper** : Use the ''Payload Variable Helper'' button to insert variables into your payload template. ==== Available Variables ==== You can use variables from the following categories in your payload template: * **Alarm Variables**: Information about the alarm * **Organization Variables**: Information about the organization * **Group Variables**: Information about the group * **System Variables**: Information about the system * **Connector Variables**: Information about the connector * **Properties Variables**: Custom properties defined in your system **Notes:** * Ensure that all variables used in your template are correctly formatted and correspond to existing data fields * Ensure that the Elasticsearch instance is reachable and properly configured to accept data from your application. ===== Troubleshooting ===== If you encounter issues: * Verify the hostname and port (Standard Configuration) or the Cloud ID and API key (Cloud Configuration). * Check Elasticsearch logs for any errors related to authentication or index operations. * Ensure that the indices specified in the configuration exist in Elasticsearch and have the appropriate permissions set for the configured user.