---
title: Elasticsearch
summary: Fastly will upload log messages periodically to the server in the format specified in the Elasticsearch object.
url: https://www.fastly.com/documentation/reference/api/logging/elasticsearch
---

Fastly will upload log messages periodically to the server in the format specified in the Elasticsearch object.

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `format` | string | A Fastly <a href="https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/">log format string</a>. Must produce valid JSON that Elasticsearch can ingest. |
| `index` | string | The name of the Elasticsearch index to send documents (logs) to. The index must follow the Elasticsearch <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html">index format rules</a>. We support <a href="https://www.man7.org/linux/man-pages/man3/strftime.3.html">strftime</a> interpolated variables inside braces prefixed with a pound symbol. For example, <code>#{%F}</code> will interpolate as <code>YYYY-MM-DD</code> with today's date. |
| `password` | string | Basic Auth password. |
| `pipeline` | string | The ID of the Elasticsearch ingest pipeline to apply pre-process transformations to before indexing. Learn more about creating a pipeline in the <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest.html">Elasticsearch docs</a>. |
| `url` | string | The URL to stream logs to. Must use HTTPS. |
| `user` | string | Basic Auth username. |
| `format_version` | integer | The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in <code>vcl_log</code> if <code>format_version</code> is set to <code>2</code> and in <code>vcl_deliver</code> if <code>format_version</code> is set to <code>1</code>. |
| `log_processing_region` | string | The geographic region where the logs will be processed before streaming. Valid values are <code>us</code>, <code>eu</code>, and <code>none</code> for global. |
| `name` | string | The name for the real-time logging configuration. |
| `placement` | string | Where in the generated VCL the logging call should be placed. If not set, endpoints with <code>format_version</code> of 2 are placed in <code>vcl_log</code> and those with <code>format_version</code> of 1 are placed in <code>vcl_deliver</code>. |
| `request_max_bytes` | integer | The maximum number of bytes sent in one request. Defaults <code>0</code> for unbounded. |
| `request_max_entries` | integer | The maximum number of logs sent in one request. Defaults <code>0</code> for unbounded. |
| `response_condition` | string | The name of an existing condition in the configured endpoint, or leave blank to always execute. |
| `tls_ca_cert` | string | A secure certificate to authenticate a server with. Must be in PEM format. |
| `tls_client_cert` | string | The client certificate used to make authenticated requests. Must be in PEM format. |
| `tls_client_key` | string | The client private key used to make authenticated requests. Must be in PEM format. |
| `tls_hostname` | string | The hostname to verify the server's certificate. This should be one of the Subject Alternative Name (SAN) fields for the certificate. Common Names (CN) are not supported. |
| `created_at` | string | Date and time in ISO 8601 format. (Read-only) |
| `deleted_at` | string | Date and time in ISO 8601 format. (Read-only) |
| `service_id` | string | Alphanumeric string identifying the service. (Read-only) |
| `updated_at` | string | Date and time in ISO 8601 format. (Read-only) |
| `version` | string | String identifying a service version. (Read-only) |

## API endpoints

### List Elasticsearch log endpoints

**GET** `/service/{service_id}/version/{version_id}/logging/elasticsearch`

List all of the Elasticsearch logging endpoints for a particular service and version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Create an Elasticsearch log endpoint

**POST** `/service/{service_id}/version/{version_id}/logging/elasticsearch`

Create a Elasticsearch logging endpoint for a particular service and version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Get an Elasticsearch log endpoint

**GET** `/service/{service_id}/version/{version_id}/logging/elasticsearch/{logging_elasticsearch_name}`

Get the Elasticsearch logging endpoint for a particular service and version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `logging_elasticsearch_name` | string | path | Yes | The name for the real-time logging configuration. |
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Update an Elasticsearch log endpoint

**PUT** `/service/{service_id}/version/{version_id}/logging/elasticsearch/{logging_elasticsearch_name}`

Update the Elasticsearch logging endpoint for a particular service and version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `logging_elasticsearch_name` | string | path | Yes | The name for the real-time logging configuration. |
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Delete an Elasticsearch log endpoint

**DELETE** `/service/{service_id}/version/{version_id}/logging/elasticsearch/{logging_elasticsearch_name}`

Delete the Elasticsearch logging endpoint for a particular service and version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `logging_elasticsearch_name` | string | path | Yes | The name for the real-time logging configuration. |
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

