Skip to content

Doc: Add clarification about API key format for Logstash #17688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

vishaangelova
Copy link
Contributor

@vishaangelova vishaangelova commented May 26, 2025

Release notes

[rn:skip]

What does this PR do?

This PR clarifies the API key format required for Logstash in the following docs:

  • docs/reference/secure-connection.md
  • docs/reference/connecting-to-cloud.md
  • docs/reference/using-logstash-with-elastic-integrations.md

Related issues

Closes #17687

Changes

(All links are to the PR preview)

Previews

https://docs-v3-preview.elastic.dev/elastic/logstash/pull/17688/reference
https://docs-v3-preview.elastic.dev/elastic/logstash/pull/17688/reference/secure-connection
https://docs-v3-preview.elastic.dev/elastic/logstash/pull/17688/reference/connecting-to-cloud
https://docs-v3-preview.elastic.dev/elastic/logstash/pull/17688/reference/using-logstash-with-elastic-integrations

@vishaangelova vishaangelova added enhancement docs backport-active-9 Automated backport with mergify to all the active 9.[0-9]+ branches labels May 26, 2025
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@vishaangelova vishaangelova self-assigned this May 26, 2025
@vishaangelova vishaangelova requested a review from ppf2 May 26, 2025 21:53
@vishaangelova vishaangelova marked this pull request as draft May 27, 2025 11:01
@vishaangelova vishaangelova marked this pull request as ready for review May 28, 2025 08:51
@vishaangelova vishaangelova force-pushed the serverless-clarify-api-key-when-using-logstash branch from ee532b4 to aea8d98 Compare June 4, 2025 09:02
@vishaangelova vishaangelova force-pushed the serverless-clarify-api-key-when-using-logstash branch from aea8d98 to c6d674e Compare June 4, 2025 09:05
@karenzone
Copy link
Contributor

Looking...

Copy link
Contributor

@karenzone karenzone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left suggestions (and questions) inline. Thanks for your work on this.

@@ -19,7 +19,8 @@ Logstash accelerates your insights by harnessing a greater volume and variety of
You’ll use the {{ls}} [{{es}} output plugin](logstash-docs-md://lsr/plugins-outputs-elasticsearch.md) to send data to {{serverless-full}}.
Note these differences between {{es-serverless}} and both {{ess}} and self-managed {{es}}:

* Use **API keys** to access {{serverless-full}} from {{ls}}. Any user-based security settings in your [{{es}} output plugin](logstash-docs-md://lsr/plugins-outputs-elasticsearch.md) configuration are ignored and may cause errors.
* You must use [**API keys**](/reference/secure-connection.md#ls-api-keys) to access {{serverless-full}} from {{ls}} as it does not support native user authentication. Any user-based security settings in your [{{es}} output plugin](logstash-docs-md://lsr/plugins-outputs-elasticsearch.md) configuration are ignored and may cause errors.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* You must use [**API keys**](/reference/secure-connection.md#ls-api-keys) to access {{serverless-full}} from {{ls}} as it does not support native user authentication. Any user-based security settings in your [{{es}} output plugin](logstash-docs-md://lsr/plugins-outputs-elasticsearch.md) configuration are ignored and may cause errors.
* Use [**API keys**](/reference/secure-connection.md#ls-api-keys) to access {{serverless-full}} from {{ls}}.
Any user-based security settings in your [{{es}} output plugin](logstash-docs-md://lsr/plugins-outputs-elasticsearch.md) configuration are ignored and may cause errors.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The link to the relevant section is a nice addition. Let's keep the simpler, imperative statement format, and apply the one-sentence-per-line standard for easier GitHub edits and suggestions in the future.

@@ -74,6 +74,7 @@ output { <3>
1. Use `filter-elastic_integration` as the first filter in your pipeline
2. You can use additional filters as long as they follow `filter-elastic_integration`
3. Sample config to output data to multiple destinations
4. The format of the value is `id:api_key`, where `id` and `api_key` are the values returned by the [Create API key API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-api-key)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This topic is a high-level snippet designed to illustrate what's involved in using the elastic_integration filter. It's an incomplete configuration, and the details about one config setting out of 75 don't seem appropriate.

@@ -37,6 +37,8 @@ Configuration example:

* `output {elasticsearch { cloud_id => "<cloud id>" api_key => "<api key>" } }`

Note that the value of the [`api_key` option](logstash-docs-md://lsr/plugins-outputs-elasticsearch.md#plugins-outputs-elasticsearch-api_key) is in the format `id:api_key`, where `id` and `api_key` are the values returned by the [Create API key API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-api-key).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Note that the value of the [`api_key` option](logstash-docs-md://lsr/plugins-outputs-elasticsearch.md#plugins-outputs-elasticsearch-api_key) is in the format `id:api_key`, where `id` and `api_key` are the values returned by the [Create API key API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-api-key).

@@ -53,6 +55,8 @@ Configuration example:
* `output {elasticsearch { cloud_id => "<cloud id>" cloud_auth => "<cloud auth>" } }`
* `output {elasticsearch { cloud_id => "<cloud id>" api_key => "<api key>" } }`

Note that the value of the [`api_key` option](logstash-docs-md://lsr/plugins-outputs-elasticsearch.md#plugins-outputs-elasticsearch-api_key) is in the format `id:api_key`, where `id` and `api_key` are the values returned by the [Create API key API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-api-key).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Note that the value of the [`api_key` option](logstash-docs-md://lsr/plugins-outputs-elasticsearch.md#plugins-outputs-elasticsearch-api_key) is in the format `id:api_key`, where `id` and `api_key` are the values returned by the [Create API key API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-api-key).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The api_key link with this information is already available in the previous sentence, and makes this same information available to anybody who clicks it.

@@ -292,11 +296,20 @@ Tips for creating API keys:
* {{ls}} can send both collected data and monitoring information to {{es}}. If you are sending both to the same cluster, you can use the same API key. For different clusters, you need an API key per cluster.
* A single cluster can share a key for ingestion and monitoring purposes.
* A production cluster and a monitoring cluster require separate keys.
* When you create an API key for Logstash on the UI of your deployment, once the API key is generated, make sure you select **Logstash** from the dropdown to copy the API key in the correct `id:api_key` format. Note that base64 encoded API keys are not supported in the {{ls}} configuration.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* When you create an API key for Logstash on the UI of your deployment, once the API key is generated, make sure you select **Logstash** from the dropdown to copy the API key in the correct `id:api_key` format. Note that base64 encoded API keys are not supported in the {{ls}} configuration.
* When you create an API key for Logstash, select **Logstash** from the **API key format** dropdown.
This option formats the API key in the correct id:api_key format required by Logstash.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ToDo: Is this applicable for serverless, Cloud, and self-managed?

:width: 400px
:::

Depending on the deployment, the UI for creating API keys and the API key format dropdown may be slightly different.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Depending on the deployment, the UI for creating API keys and the API key format dropdown may be slightly different.
The UI for API keys may look different depending on the deployment type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-active-9 Automated backport with mergify to all the active 9.[0-9]+ branches docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Serverless]: Clarify API key when using Logstash
3 participants