const apiInstance = new Fastly.LoggingElasticsearchApi();
Note
All URIs are relative to https://api.fastly.com
Method | HTTP request | Description |
---|---|---|
createLogElasticsearch | POST /service/{service_id}/version/{version_id}/logging/elasticsearch | Create an Elasticsearch log endpoint |
deleteLogElasticsearch | DELETE /service/{service_id}/version/{version_id}/logging/elasticsearch/{logging_elasticsearch_name} | Delete an Elasticsearch log endpoint |
getLogElasticsearch | GET /service/{service_id}/version/{version_id}/logging/elasticsearch/{logging_elasticsearch_name} | Get an Elasticsearch log endpoint |
listLogElasticsearch | GET /service/{service_id}/version/{version_id}/logging/elasticsearch | List Elasticsearch log endpoints |
updateLogElasticsearch | PUT /service/{service_id}/version/{version_id}/logging/elasticsearch/{logging_elasticsearch_name} | Update an Elasticsearch log endpoint |
createLogElasticsearch({ service_id, version_id, [name, ][placement, ][response_condition, ][format, ][format_version, ][tls_ca_cert, ][tls_client_cert, ][tls_client_key, ][tls_hostname, ][request_max_entries, ][request_max_bytes, ][index, ][url, ][pipeline, ][user, ][password] })
Create a Elasticsearch logging endpoint for a particular service and version.
const options = {
service_id: "service_id_example", // required
version_id: 56, // required
name: "name_example",
placement: "none",
response_condition: "response_condition_example",
format: "format_example",
format_version: 1,
tls_ca_cert: "'null'",
tls_client_cert: "'null'",
tls_client_key: "'null'",
tls_hostname: "'null'",
request_max_entries: 0,
request_max_bytes: 0,
index: "index_example",
url: "url_example",
pipeline: "pipeline_example",
user: "user_example",
password: "password_example",
};
apiInstance.createLogElasticsearch(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
service_id | String | Alphanumeric string identifying the service. | |
version_id | Number | Integer identifying a service version. | |
name | String | The name for the real-time logging configuration. | [optional] |
placement | String | Where in the generated VCL the logging call should be placed. If not set, endpoints with format_version of 2 are placed in vcl_log and those with format_version of 1 are placed in vcl_deliver . |
[optional] [one of: "none", "waf_debug", "null"] |
response_condition | String | The name of an existing condition in the configured endpoint, or leave blank to always execute. | [optional] |
format | String | A Fastly log format string. Must produce valid JSON that Elasticsearch can ingest. | [optional] |
format_version | Number | The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in vcl_log if format_version is set to 2 and in vcl_deliver if format_version is set to 1 . |
[optional] [one of: 1, 2] |
tls_ca_cert | String | A secure certificate to authenticate a server with. Must be in PEM format. | [optional] [defaults to 'null'] |
tls_client_cert | String | The client certificate used to make authenticated requests. Must be in PEM format. | [optional] [defaults to 'null'] |
tls_client_key | String | The client private key used to make authenticated requests. Must be in PEM format. | [optional] [defaults to 'null'] |
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. | [optional] [defaults to 'null'] |
request_max_entries | Number | The maximum number of logs sent in one request. Defaults 0 for unbounded. |
[optional] [defaults to 0] |
request_max_bytes | Number | The maximum number of bytes sent in one request. Defaults 0 for unbounded. |
[optional] [defaults to 0] |
index | String | The name of the Elasticsearch index to send documents (logs) to. The index must follow the Elasticsearch index format rules. We support strftime interpolated variables inside braces prefixed with a pound symbol. For example, #{%F} will interpolate as YYYY-MM-DD with today's date. |
[optional] |
url | String | The URL to stream logs to. Must use HTTPS. | [optional] |
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 Elasticsearch docs. | [optional] |
user | String | Basic Auth username. | [optional] |
password | String | Basic Auth password. | [optional] |
deleteLogElasticsearch({ service_id, version_id, logging_elasticsearch_name })
Delete the Elasticsearch logging endpoint for a particular service and version.
const options = {
service_id: "service_id_example", // required
version_id: 56, // required
logging_elasticsearch_name: "logging_elasticsearch_name_example", // required
};
apiInstance.deleteLogElasticsearch(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
service_id | String | Alphanumeric string identifying the service. | |
version_id | Number | Integer identifying a service version. | |
logging_elasticsearch_name | String | The name for the real-time logging configuration. |
getLogElasticsearch({ service_id, version_id, logging_elasticsearch_name })
Get the Elasticsearch logging endpoint for a particular service and version.
const options = {
service_id: "service_id_example", // required
version_id: 56, // required
logging_elasticsearch_name: "logging_elasticsearch_name_example", // required
};
apiInstance.getLogElasticsearch(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
service_id | String | Alphanumeric string identifying the service. | |
version_id | Number | Integer identifying a service version. | |
logging_elasticsearch_name | String | The name for the real-time logging configuration. |
listLogElasticsearch({ service_id, version_id })
List all of the Elasticsearch logging endpoints for a particular service and version.
const options = {
service_id: "service_id_example", // required
version_id: 56, // required
};
apiInstance.listLogElasticsearch(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
service_id | String | Alphanumeric string identifying the service. | |
version_id | Number | Integer identifying a service version. |
[LoggingElasticsearchResponse]
updateLogElasticsearch({ service_id, version_id, logging_elasticsearch_name, [name, ][placement, ][response_condition, ][format, ][format_version, ][tls_ca_cert, ][tls_client_cert, ][tls_client_key, ][tls_hostname, ][request_max_entries, ][request_max_bytes, ][index, ][url, ][pipeline, ][user, ][password] })
Update the Elasticsearch logging endpoint for a particular service and version.
const options = {
service_id: "service_id_example", // required
version_id: 56, // required
logging_elasticsearch_name: "logging_elasticsearch_name_example", // required
name: "name_example",
placement: "none",
response_condition: "response_condition_example",
format: "format_example",
format_version: 1,
tls_ca_cert: "'null'",
tls_client_cert: "'null'",
tls_client_key: "'null'",
tls_hostname: "'null'",
request_max_entries: 0,
request_max_bytes: 0,
index: "index_example",
url: "url_example",
pipeline: "pipeline_example",
user: "user_example",
password: "password_example",
};
apiInstance.updateLogElasticsearch(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
service_id | String | Alphanumeric string identifying the service. | |
version_id | Number | Integer identifying a service version. | |
logging_elasticsearch_name | String | The name for the real-time logging configuration. | |
name | String | The name for the real-time logging configuration. | [optional] |
placement | String | Where in the generated VCL the logging call should be placed. If not set, endpoints with format_version of 2 are placed in vcl_log and those with format_version of 1 are placed in vcl_deliver . |
[optional] [one of: "none", "waf_debug", "null"] |
response_condition | String | The name of an existing condition in the configured endpoint, or leave blank to always execute. | [optional] |
format | String | A Fastly log format string. Must produce valid JSON that Elasticsearch can ingest. | [optional] |
format_version | Number | The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in vcl_log if format_version is set to 2 and in vcl_deliver if format_version is set to 1 . |
[optional] [one of: 1, 2] |
tls_ca_cert | String | A secure certificate to authenticate a server with. Must be in PEM format. | [optional] [defaults to 'null'] |
tls_client_cert | String | The client certificate used to make authenticated requests. Must be in PEM format. | [optional] [defaults to 'null'] |
tls_client_key | String | The client private key used to make authenticated requests. Must be in PEM format. | [optional] [defaults to 'null'] |
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. | [optional] [defaults to 'null'] |
request_max_entries | Number | The maximum number of logs sent in one request. Defaults 0 for unbounded. |
[optional] [defaults to 0] |
request_max_bytes | Number | The maximum number of bytes sent in one request. Defaults 0 for unbounded. |
[optional] [defaults to 0] |
index | String | The name of the Elasticsearch index to send documents (logs) to. The index must follow the Elasticsearch index format rules. We support strftime interpolated variables inside braces prefixed with a pound symbol. For example, #{%F} will interpolate as YYYY-MM-DD with today's date. |
[optional] |
url | String | The URL to stream logs to. Must use HTTPS. | [optional] |
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 Elasticsearch docs. | [optional] |
user | String | Basic Auth username. | [optional] |
password | String | Basic Auth password. | [optional] |