Skip to content

Commit

Permalink
Merge pull request #2768 from rockwotj/elastic-serverless
Browse files Browse the repository at this point in the history
elasticsearch: add example for serverless tier
  • Loading branch information
mihaitodor authored Aug 15, 2024
2 parents 42de857 + e7b8f1f commit 88015ab
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
24 changes: 24 additions & 0 deletions docs/modules/components/pages/outputs/elasticsearch.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,30 @@ This output benefits from sending multiple messages in flight in parallel for im
This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more xref:configuration:batching.adoc[in this doc].
== Examples
[tabs]
======
Elastic Cloud Serverless::
+
--
This is an example of writing data to https://www.elastic.co/docs/current/serverless[Elastic Cloud serverless^].
```yaml
output:
elasticsearch:
urls: ["https://${ELASTIC_CLOUD_CLUSTER_ID}.es.us-east-1.aws.elastic.cloud:443"]
sniff: false
healthcheck: false
index: "my-elasticsearch-index"
id: my-document-id-${!count("elastic_ids")}-${!timestamp_unix()}
api_key: "${ELASTIC_CLOUD_API_KEY}"
```
--
======
== Fields
=== `urls`
Expand Down
15 changes: 14 additions & 1 deletion internal/impl/elasticsearch/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,20 @@ It's possible to enable AWS connectivity with this output using the `+"`aws`"+`
Description("Enable gzip compression on the request side.").
Advanced().
Default(false),
)
).
Example(
"Elastic Cloud Serverless",
"This is an example of writing data to https://www.elastic.co/docs/current/serverless[Elastic Cloud serverless^].",
`
output:
elasticsearch:
urls: ["https://${ELASTIC_CLOUD_CLUSTER_ID}.es.us-east-1.aws.elastic.cloud:443"]
sniff: false
healthcheck: false
index: "my-elasticsearch-index"
id: my-document-id-${!count("elastic_ids")}-${!timestamp_unix()}
api_key: "${ELASTIC_CLOUD_API_KEY}"
`)
}

func init() {
Expand Down

0 comments on commit 88015ab

Please sign in to comment.