Skip to main content

Elasticsearch

Type ID: elasticsearch  ·  Kind: Action  ·  Ports: 1 in, 1 out

Search and partially update documents in an Elasticsearch or OpenSearch cluster.

Credentials​

elasticsearch (host, username, password, verify SSL)

Resources & operations​

  • Document (document)
    • Search (search) - Search documents with Query DSL
    • Update Document (updateDocument) - Partially update a document by index and id

Properties​

Common​

PropertyKeyTypeRequiredDefaultPossible valuesApplies when
ResourceresourceoptionsYesdocumentDocument (document)-
OperationoperationoptionsYessearchSearch (search), Update Document (updateDocument)resource = document
PropertyKeyTypeRequiredDefaultPossible valuesApplies when
IndexindexstringYes''Index name or pattern, e.g. logs-* or wazuh-alerts-*resource = document, operation = search
QueryqueryjsonYes{}Elasticsearch Query DSL - a query object or a full search bodyresource = document, operation = search
SizesizenumberNo1Maximum number of hits to returnresource = document, operation = search
SortsortjsonNo[]Optional sort clause, e.g. [{ "@timestamp": "desc" }]resource = document, operation = search
Retry On Empty HitsretryOnEmptyHitsbooleanNofalseRetry the search when no documents are indexed yetresource = document, operation = search
Retry Delays (seconds)retryDelaysSecarrayNo[1, 5, 10, 15]Seconds to sleep between empty-hit retriesresource = document, operation = search, retryOnEmptyHits = true

Document → Update Document​

PropertyKeyTypeRequiredDefaultPossible valuesApplies when
IndexindexstringYes''Exact index of the document to updateresource = document, operation = updateDocument
Document IDidstringYes''Elasticsearch/OpenSearch document _idresource = document, operation = updateDocument
FieldsfieldsjsonYes{}Fields to merge into the document via POST /_updateresource = document, operation = updateDocument

Notes​

  • If Retry On Empty Hits is on, the node retries on the configured delays until it gets a hit, then throws if still empty.
  • Search output: { index, doc_id, source, hits, raw }, from the first hit.
  • Update Document output: the raw Elasticsearch _update response.
  • query, sort, and fields accept a JSON string or a native object/array.