Skip to main content

ElasticSearch

This check will try to connect to a specified ElasticSearch database, run a query against it and verify the results.

Opensearch

To connect to Opensearch use opensearch field instead of elasticsearch

apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
name: elasticsearch-check
spec:
interval: 30
elasticsearch:
- url: http://elasticsearch.default.svc:9200
description: Elasticsearch checker
index: index
query: |
{
"query": {
"term": {
"system.role": "api"
}
}
}

results: 1
name: elasticsearch_pass
username:
valueFrom:
secretKeyRef:
name: elasticsearch-credentials
key: USERNAME
password:
valueFrom:
secretKeyRef:
name: elasticsearch-credentials
key: PASSWORD
FieldDescriptionSchemeRequired
indexIndex against which query should be ranstringYes
queryQuery that needs to be executed on the serverstringYes
resultsNumber of expected hitsintYes
nameName of the check, must be unique within the canarystringYes
descriptionDescription for the checkstring
iconIcon for overwriting default icon on the dashboardstring
labelsLabels for checkmap[string]string
testEvaluate whether a check is healthyExpression
displayExpression to change the formatting of the displayExpression
transformTransform data from a check into multiple individual checksExpression
metricsMetrics to export from[]Metrics
Connection
connectionPath of existing connection e.g. connection://elastic/instance
Mutually exclusive with username and password
Connection
urlURL of elastichsearch serverstringYes
username Mutually exclusive with connection EnvVar
password Mutually exclusive with connection EnvVar