Home

Awesome

docker-elastalert

Docker image for running Elastalert.

Features

Usage

Locally the docker-elastalert instance can be run using the following command:

docker-compose up -d --build

The local cluster spins up a dummy Elasticsearch container, and then the Elastalert container. When the Elastalert container starts, the CMD script runs through the following processes:

Credit

Environment Variables

Set at buildtime

These variables are set during the Docker build, and are generally necessary for running core functionality of Elastalert.

Env varElastalert config varDefaultDescription
CONFIG_FOLDERN/A/opt/elastalert/configPlace Elastalert configs here
CONTAINER_TIMEZONEN/AEtc/UTCContainer timezone value
DOCKERIZE_VERSIONN/A0.6.0Version of Dockerize binary to download
ELASTALERT_CONFIGN/A${CONFIG_FOLDER}/elastalert_config.yamlName and location of the config file referenced by src/start-elastalert to start the Python daemon
ELASTALERT_INDEXwriteback_indexelastalert_statusName of the Elastalert index in your Elasticsearch cluster
ELASTALERT_SYSTEM_GROUPN/AelastalertName of the user running Elastalert; used for the daemon and folder permissions
ELASTALERT_SYSTEM_USERN/AelastalertName of the group running Elastalert; used for the daemon and folder permissions
ELASTALERT_VERSIONN/A0.1.29Version of Elastalert to install from pip
ELASTICSEARCH_HOSTes_hostelasticsearchDesc
ELASTICSEARCH_PORTes_port9200Desc
ELASTICSEARCH_USE_SSLuse_sslFalseConnect with TLS to Elasticsearch
ELASTICSEARCH_VERIFY_CERTSverify_certsFalseUse SSL authentication with client certificates
RULES_FOLDERrules_folder/opt/elastalert/rulesFolder where Elastalert scans for rules
SET_CONTAINER_TIMEZONEN/ATrueWhether or not to set the container timezone to ${CONTAINER_TIMEZONE}

Set at runtime

These variables are settings available in the Elastalert configuration file. Most of these settings apply to third-party integrations (JIRA, OpsGenie, etc), or are things documented here: Elastalert common configuration options

Env varElastalert config varDefaultDescription
ELASTALERT_AWS_REGIONaws_regionNo default set
ELASTALERT_BUFFER_TIMEbuffer_time: => minutes:45ElastAlert will buffer results from the most recent period of time, in case some log sources are not in real time
ELASTALERT_EMAILemailNo default set
ELASTALERT_EMAIL_REPLY_TOemail_reply_toNo default set
ELASTALERT_EXOTEL_ACCOUNT_SIDexotel_account_sidNo default set
ELASTALERT_EXOTEL_AUTH_TOKENexotel_auth_tokenNo default set
ELASTALERT_EXOTEL_FROM_NUMBERexotel_from_numberNo default set
ELASTALERT_EXOTEL_TO_NUMBERexotel_to_numberNo default set
ELASTALERT_FROM_ADDRfrom_addrNo default set
ELASTALERT_GITTER_MSG_LEVELgitter_msg_levelNo default set
ELASTALERT_GITTER_PROXYgitter_proxyNo default set
ELASTALERT_GITTER_WEBHOOK_URLgitter_webhook_urlNo default set
ELASTALERT_HIPCHAT_AUTH_TOKENhipchat_auth_tokenNo default set
ELASTALERT_HIPCHAT_DOMAINhipchat_domainNo default set
ELASTALERT_HIPCHAT_FROMhipchat_fromNo default set
ELASTALERT_HIPCHAT_IGNORE_SSL_ERRORShipchat_ignore_ssl_errorsNo default set
ELASTALERT_HIPCHAT_NOTIFYhipchat_notifyNo default set
ELASTALERT_HIPCHAT_ROOM_IDhipchat_room_idNo default set
ELASTALERT_JIRA_ACCOUNT_FILEjira_account_fileNo default set
ELASTALERT_JIRA_ASSIGNEEjira_assigneeNo default set
ELASTALERT_JIRA_BUMP_IN_STATUSESjira_bump_in_statusesNo default set
ELASTALERT_JIRA_BUMP_NOT_IN_STATUSESjira_bump_not_in_statusesNo default set
ELASTALERT_JIRA_BUMP_TICKETSjira_bump_ticketsNo default set
ELASTALERT_JIRA_COMPONENTjira_componentNo default set
ELASTALERT_JIRA_COMPONENTSjira_componentsNo default set
ELASTALERT_JIRA_ISSUETYPEjira_issuetypeNo default set
ELASTALERT_JIRA_LABELjira_labelNo default set
ELASTALERT_JIRA_LABELSjira_labelsNo default set
ELASTALERT_JIRA_MAX_AGEjira_max_ageNo default set
ELASTALERT_JIRA_PROJECTjira_projectNo default set
ELASTALERT_JIRA_SERVERjira_serverNo default set
ELASTALERT_JIRA_WATCHERSjira_watchersNo default set
ELASTALERT_NOTIFY_EMAILnotify_emailNo default set
ELASTALERT_OPSGENIE_ACCOUNTopsgenie_accountNo default set
ELASTALERT_OPSGENIE_ADDRopsgenie_addrNo default set
ELASTALERT_OPSGENIE_ALIASopsgenie_aliasNo default set
ELASTALERT_OPSGENIE_KEYopsgenie_keyNo default set
ELASTALERT_OPSGENIE_MESSAGEopsgenie_messageNo default set
ELASTALERT_OPSGENIE_PROXYopsgenie_proxyNo default set
ELASTALERT_OPSGENIE_RECIPIENTSopsgenie_recipientsNo default set
ELASTALERT_OPSGENIE_TAGSopsgenie_tagsNo default set
ELASTALERT_OPSGENIE_TEAMSopsgenie_teamsNo default set
ELASTALERT_PAGERDUTY_CLIENT_NAMEpagerduty_client_nameNo default set
ELASTALERT_PAGERDUTY_EVENT_TYPEpagerduty_event_typeNo default set
ELASTALERT_PAGERDUTY_SERVICE_KEYpagerduty_service_keyNo default set
ELASTALERT_RUN_EVERYrun_every: => minutes:3Number of minutes to wait before re-checking Elastalert rules. Currently only available as values in minutes
ELASTALERT_SLACK_EMOJI_OVERRIDEslack_emoji_overrideNo default set
ELASTALERT_SLACK_ICON_URL_OVERRIDEslack_icon_url_overrideNo default set
ELASTALERT_SLACK_MSG_COLORslack_msg_colorNo default set
ELASTALERT_SLACK_PARSE_OVERRIDEslack_parse_overrideNo default set
ELASTALERT_SLACK_TEXT_STRINGslack_text_stringNo default set
ELASTALERT_SLACK_USERNAME_OVERRIDEslack_username_overrideNo default set
ELASTALERT_SLACK_WEBHOOK_URLslack_webhook_urlNo default set
ELASTALERT_SMTP_HOSTsmtp_hostNo default set
ELASTALERT_TELEGRAM_API_URLtelegram_api_urlNo default set
ELASTALERT_TELEGRAM_BOT_TOKENtelegram_bot_tokenNo default set
ELASTALERT_TELEGRAM_ROOM_IDtelegram_room_idNo default set
ELASTALERT_TIME_LIMITalert_time_limit: => minutes:5If an alert fails for some reason, ElastAlert will retry sending the alert until this time period has elapsed
ELASTALERT_TWILIO_ACCOUNT_SIDtwilio_account_sidNo default set
ELASTALERT_TWILIO_AUTH_TOKENtwilio_auth_tokenNo default set
ELASTALERT_TWILIO_FROM_NUMBERtwilio_from_numberNo default set
ELASTALERT_TWILIO_TO_NUMBERtwilio_to_numberNo default set
ELASTALERT_VICTOROPS_API_KEYvictorops_api_keyNo default set
ELASTALERT_VICTOROPS_ENTITY_DISPLAY_NAMEvictorops_entity_display_nameNo default set
ELASTALERT_VICTOROPS_MESSAGE_TYPEvictorops_message_typeNo default set
ELASTALERT_VICTOROPS_ROUTING_KEYvictorops_routing_keyNo default set
ELASTICSEARCH_CA_CERTSca_certsNo default set
ELASTICSEARCH_CLIENT_CERTclient_certNo default set
ELASTICSEARCH_CLIENT_KEYclient_keyNo default set
ELASTICSEARCH_PASSWORDes_passwordNo default set
ELASTICSEARCH_SEND_GET_BODY_ASes_send_get_body_asNo default set
ELASTICSEARCH_URL_PREFIXes_url_prefixNo default set
ELASTICSEARCH_USERes_usernameNo default set