Skip to main content

Elasticsearch

Elasticsearch is a tool that is used for full-text search and analytics. It is widely used as an open-source logging database and offers real-time, distributed, and analytics capabilities. It is a highly scalable document storage engine, that stores data in document format, and allows users to perform advanced queries for detailed analysis. The integration of Elasticsearch with Spot Connect provides you with the ability to interact with data in Elasticsearch within their automation workflows, utilizing the search API.

The integration between Spot Connect and Elasticsearch enables you to use the search action – it returns search requests that match the query defined in the request. You can provide search queries using the query string parameter or request body.

Configure Elasticsearch in Spot Connect

  1. In the left main menu, click Connect and click Settings.
  2. Under the Integrations tab, select Elasticsearch.
  3. Configure a new integration instance with the information below.

Details needed to set up an Elasticsearch integration instance in Spot Connect:

ParameterDescriptionRequired
Integration AliasName for an Elasticsearch integration instanceTrue
Elasticsearch Cloud IdUnique ID to configure your client to work with your Elastic Cloud deploymentTrue
Elasticsearch API key IdElasticsearch API key IDTrue
Elasticsearch API key valueElasticsearch API key valueTrue

Follow the steps listed below in your Elasticsearch Account and get the desired parameters to enter in Spot Connect.

  1. Sign in to your Elasticsearch cloud.

    elasticsearch-1

  2. Open your created deployment (eg: sample_deploy) that you want to integrate.

  3. In the left menu, click Management and then click Dev Tools.

  4. Run the following query and copy the output:

    POST /_security/api_key
    {
    "name": "spotconnect_api_key",
    "role_descriptors": {
    "role1": {
    "indices": [
    {
    "names": [
    "*"
    ],
    "privileges": [
    "read"
    ]
    }
    ]
    }
    }
    }

    The output should be:

    {
    "id": "HxRjM4wBFbfDSJb",
    "name": "spotconnect_api_key",
    "api_key": "Uu0nmfAWSJWZ",
    "encoded": "SHhSak00d0JGYmZEU0piOF9"
    }
  5. Copy the value of id and enter it in the Elasticsearch API key id field. Copy value of api_key and enter it in the Elastic Search API key value field.

Integration Actions

You can add this action in the Spot Connect workflow builder, as part of your workflow:

Use this action to perform an Elasticsearch search.

Input

Parameter NameDescriptionRequired
Elasticsearch InstanceSelect an Elasticsearch integration instanceTrue
IndexElasticsearch index where query to be performedTrue
QuerySearch query to be run on the given indexTrue
S3 BucketS3 bucket name where query and result would be storedFalse
OffsetOffset of query resultFalse
LimitLimit of query resultFalse
TimeoutTime in seconds to timeout the search query (Default: 300 s)False

Output

Parameter NameTypeDescription
resultObjectQuery result
is_result_truncatedBooleanBoolean value which denotes if the result is truncated or not
result_bucket_keyStringName of the file where result is written
s3_bucketStringName of the bucket
execution_statusStringStatus of run (ie: S_OK / E_FAIL)
note

The Spot Connect workflow execution engine has a limit for the response object size of about 100 KB. If the query has a result greater than this value, then a truncated result would be returned. If the S3 Bucket name is provided, then the whole result would be written in the bucket.

Action Example

Input

elasticsearch-2

Output

elasticsearch-3

elasticsearch-4