Connector clients
Set up and deploy self-managed connectors that run on your own infrastructure.
Note
This page contains high-level instructions about setting up connector clients in your project's UI. Because prerequisites and configuration details vary by data source, you'll need to refer to the individual connector documentation for specific details.
A connector is a type of Elastic integration that syncs data from an original data source to Elasticsearch. Each connector extracts the original files, records, or objects; and transforms them into documents within Elasticsearch.
Connector clients are self-managed connectors that you run on your own infrastructure.
These connectors are written in Python and the source code is available in the elastic/connectors
repo.
Available connectors
Connector clients are available for the following third-party data sources:
Overview
Because connector clients are self-managed on your own infrastructure, they run outside of your Elasticsearch serverless project.
You can run them from source or in a Docker container.
Workflow
In order to set up, configure, and run a connector you'll be moving between your third-party service, the Elasticsearch Serverless UI, and your terminal. At a high-level, the workflow looks like this:
- Satisfy any data source prerequisites (e.g., create an OAuth application).
- Create a connector in the UI.
- Deploy the connector service from source or with Docker.
- Enter data source configuration details in the UI.
Data source prerequisites
The first decision you need to make before deploying a connector is which third party service (data source) you want to sync to Elasticsearch. See the list of available connectors.
Note that each data source will have specific prerequisites you'll need to meet to authorize the connector to access its data. For example, certain data sources may require you to create an OAuth application, or create a service account. You'll need to check the individual connector documentation for these details.
Initial setup in UI
In your project's UI, go to Elasticsearch → Connectors. Read the high-level instructions under Create a connector to make sure you understand the process. Follow these steps:
- Select Create a connector.
- Choose a third-party service from the list of connector types.
- Add a name and optional description to identify the connector.
- Copy the
connector_id
,service_type
, andelasticsearch.host
values printed to the screen. You'll need to update these values in yourconfig.yml
file. - Make a note of your Elasticsearch endpoint and API key values. You can create a new API key under Security → API keys.
- Run the connector code using one of the options documented on this page.
Deploy your self-managed connector
To use connector clients, you must deploy the connector service so your connector can talk to your Elasticsearch instance.
The source code is hosted in the elastic/connectors
repository.
You have two deployment options:
You'll need the following values handy to update your config.yml
file:
elasticsearch.host
: Your Elasticsearch endpoint. Find this in the Get started step in the UI.elasticsearch.api_key
: Your Elasticsearch API key. You can create API keys under Security → API keys. Once you connector is running, you'll be able to create a new API key that is limited to only access the connector's index.connector_id
: Unique id for your connector. Printed to the screen when you create a new connector.service_type
: Original data source type. Printed to the screen when you create a new connector.
Run from source
This is a good option if you're comfortable working with Python and want to iterate quickly locally.
First, you need to clone the elastic/connectors
repository.
Follow these steps:
-
Clone or fork the repository locally with the following command:
git clone https://github.com/elastic/connectors
-
Create a
config.yml
configuration file by copying this example. -
Replace the values for
host
(your Elasticsearch endpoint),api_key
,connector_id
, andservice_type
.Tip
Learn more about the
config.yml
file in the repo docs.
Run the connector service
Once you've configured the connector code, you can run the connector service.
In your terminal or IDE:
-
cd
into the root of yourelastic/connectors
clone/fork. -
Run the following commands to compile and run the connector service:
make install make run
The connector service should now be running in your terminal. Your project's UI will let you know that the connector has successfully connected to your Elasticsearch instance.
Here we're working locally. In a production setup, you'll deploy the connector service to your own infrastructure.
Run with Docker
You can also deploy connector clients using Docker. Follow these instructions.
Step 1: Download sample configuration file
You can either download the configuration file manually or run the following command:
curl https://raw.githubusercontent.com/elastic/connectors/main/config.yml.example --output </absolute/path/to>/connectors-config/config.yml
Change the --output
argument value to the path where you want to save the configuration file.
Step 2: Update the configuration file for your self-managed connector
Update the following settings to match your environment:
elasticsearch.host
elasticsearch.api_key
connectors
Your configuration file should look like this:
elasticsearch.host: <ELASTICSEARCH_ENDPOINT>
elasticsearch.api_key: <ELASTICSEARCH_API_KEY>
connectors:
-
connector_id: <CONNECTOR_ID_FROM_UI>
service_type: <SERVICE-NAME> # sharepoint_online (example)
api_key: <CONNECTOR_API_KEY> # Optional. If not provided, the connector will use the elasticsearch.api_key instead
Step 3: Run the Docker image
Use the following command, substituting values where necessary:
docker run \
-v "</absolute/path/to>/connectors-config:/config" \ # NOTE: change absolute path to match where config.yml is located on your machine
--tty \
--rm \
docker.elastic.co/enterprise-search/elastic-connectors:{version}.0 \
/app/bin/elastic-ingest \
-c /config/config.yml # Path to your configuration file in the container
Find all available Docker images in the official Elastic Docker registry.
Tip
Each individual connector client reference contain instructions for deploying specific connectors using Docker.
Enter data source details in UI
Once the connector service is running, it's time to head back to the UI to finalize the connector configuration. You should now see the Configure your connector step in your project's UI.
In this step, you need to add the specific connection details about your data source instance, like URL, authorization credentials, etc. These details will vary based on the third-party data source you’re connecting to.
For example, the Sharepoint Online connector requires the following details about your Sharepoint instance:
- Tenant ID
- Tenant name
- Client ID
- Secret value
- Comma-separated list of tables
Connect to an index
Once you've entered the data source details, you need to connect to an index. This is the final step in your project's UI, before you can run a sync.
You can choose to sync to an existing Elasticsearch index, or create a new index for your connector. You can also create an API key that is limited to only access your selected index.
Index name prefix
Due to a bug, you must prefix your index name with search-
, otherwise you will hit an error.
For example, search-my-index
is a valid index name, but my-index
is not.
Note
When choosing an existing index for the connector to sync to, please ensure mappings are defined and are appropriate for incoming data. Connectors will not successfully sync to existing indices without mappings. If you are unsure about managing index mappings, choose to have your connector create the new index.
Once this step is completed, you're ready to run a sync. When a sync is launched you'll start to see documents being added to your Elasticsearch index.
Learn how syncing works in the elastic/connectors
repo docs.
Learn more
- Read the main Elastic connectors documentation
- The Elastic connector framework enables you to:
- Customize existing connector clients.
- Build your own connector clients.