We extract Elasticsearch's metadata by using its [API](https://www.elastic.co/guide/en/elasticsearch/reference/current/rest-apis.html). To run this ingestion, you just need a user with permissions to the ElasticSearch instance.
**hostPort**: This parameter specifies the host and port of the Elasticsearch instance. This should be specified as a URI string in the format `http://hostname:port` or `https://hostname:port`. For example, you might set it to `https://localhost:9200`.
{% /codeInfo %}
{% codeInfo srNumber=2 %}
**Basic Authentication**
**username**: Username to connect to Elasticsearch required when Basic Authentication is enabled on Elasticsearch.
**password**: Password of the user account to connect with Elasticsearch.
{% /codeInfo %}
{% codeInfo srNumber=3 %}
**API Key Authentication**
**apiKey**: API Key to connect to Elasticsearch required when API Key Authentication is enabled on Elasticsearch.
**apiKeyId**: Enter API Key ID In case of API Key Authentication if there is any API Key ID associated with the API Key, otherwise this field can be left blank or skipped.
{% /codeInfo %}
{% codeInfo srNumber=4 %}
- **sslConfig**:
1. SSL Certificates By Path
- caCertPath: This field specifies the path of CA certificate required for authentication.
- clientCertPath: This field specifies the path of Clint certificate required for authentication.
- privateKeyPath: This field specifies the path of Clint Key/Private Key required for authentication.
2. SSL Certificates By Value
- caCertValue: This field specifies the value of CA certificate required for authentication.
- clientCertValue: This field specifies the value of Clint certificate required for authentication.
- privateKeyValue: This field specifies the value of Clint Key/Private Key required for authentication.
- stagingDir: This field specifies the path to temporary staging directory, where the certificates will be stored temporarily during the ingestion process, which will de deleted once the ingestion job is over.
- when you are using this approach make sure you are passing the key in a correct format. If your certificate looks like this:
```
-----BEGIN CERTIFICATE-----
MII..
MBQ...
CgU..
8Lt..
...
h+4=
-----END CERTIFICATE-----
```
You will have to replace new lines with `\n` and the final value that you need to pass should look like this: