Loading

Running from the source code

The basic way to run connectors is to clone the repository and run the code locally. This is a good option if you are comfortable with Python and want to iterate quickly.

Follow the Connector workflow in the Kibana UI to select the Connector ingestion method.

Next, complete these steps:

  1. Choose which third-party service you’d like to use by selecting a data source.

  2. Create and name a new Elasticsearch index.

  3. Generate a new API key and save it somewhere safe.

  4. Name your connector and provide an optional description

  5. Convert managed connector to a self-managed connector (Only applicable if connector is also available natively). This action is irreversible.

  6. Copy the configuration block from the example shown on the screen. You’ll use this in a later step:

    # ...
    connectors:
      - connector_id: <CONNECTOR-ID>
        api_key: <API-KEY>1
        service_type: gmail2
    
    1. Scoped API key for this connector (optional). If not specified, the top-level `elasticsearch.api_key` value is used.
    2. example

Once you’ve created an index, and entered the access details for your data source, you’re ready to deploy the connector service.

First, you need to clone the elastic/connectors repository.

Follow these steps:

  • Clone or fork the connectors repository locally with the following command: git clone https://github.com/elastic/connectors.

  • Run make config to generate your initial config.yml file

  • Open the config.yml configuration file in your editor of choice.

  • Replace the values for host (your Elasticsearch endpoint), api_key, connector_id, and service_type.

Note

You need Python version 3.10 or 3.11 to run the connectors service from source.

Once you’ve configured the connector code, you can run the connector service.

In your terminal or IDE:

  1. cd into the root of your connectors clone/fork.

  2. Run the following commands to compile and run the connector service:

    make install
    make run
    

The connector service should now be running. The UI will let you know that the connector has successfully connected to your Elasticsearch instance.

As a reminder, here we’re working locally. In a production setup, you’ll deploy the connector service to your own infrastructure.