id: version-2.5.0-io-elasticsearch-sink title: ElasticSearch sink connector sidebar_label: ElasticSearch sink connector original_id: io-elasticsearch-sink

The ElasticSearch sink connector pulls messages from Pulsar topics and persists the messages to indexes.

Configuration

The configuration of the ElasticSearch sink connector has the following properties.

Property

NameTypeRequiredDefaultDescription
elasticSearchUrlStringtrue" " (empty string)The URL of elastic search cluster to which the connector connects.
indexNameStringtrue" " (empty string)The index name to which the connector writes messages.
indexNumberOfShardsintfalse1The number of shards of the index.
indexNumberOfReplicasintfalse1The number of replicas of the index.
usernameStringfalse" " (empty string)The username used by the connector to connect to the elastic search cluster.

If username is set, then password should also be provided.
passwordStringfalse" " (empty string)The password used by the connector to connect to the elastic search cluster.

If username is set, then password should also be provided.

Example

Before using the ElasticSearch sink connector, you need to create a configuration file through one of the following methods.

  • JSON

    {
        "elasticSearchUrl": "http://localhost:90902",
        "indexName": "myIndex",
        "username": "scooby",
        "password": "doobie"
    }
    
  • YAML

    configs:
        elasticSearchUrl: "http://localhost:90902"
        indexName: "myIndex"
        username: "scooby"
        password: "doobie"