Skip to content
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

[8.13] Fix examples to use API key authentication (backport #924) #927

Merged
merged 2 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ outputs:
password: changeme
----

This example is similar to the previous one, except that it uses
This example is similar to the previous one, except that it uses the recommended
<<output-elasticsearch-apikey-authentication-settings,token-based (API key) authentication>>:

[source,yaml]
Expand Down Expand Up @@ -207,6 +207,8 @@ This user needs the privileges required to publish events to {es}.
//To create a user like this, refer to <<privileges-to-publish-events>>.
// end::username-setting[]

Note that in an link:{serverless-docs}[{serverless-full}] environment you need to use <<output-elasticsearch-apikey-authentication-settings,token-based (API key) authentication>>.

// =============================================================================

|===
Expand Down Expand Up @@ -234,7 +236,7 @@ outputs:

| (string) Instead of using a username and password, you can use {kibana-ref}/api-keys.html[API keys] to
secure communication with {es}. The value must be the ID of the API key and the
API key joined by a colon: `id:api_key`.
API key joined by a colon: `id:api_key`. Token-based authentication is required in an link:{serverless-docs}[{serverless-full}] environment.
// end::api_key-setting[]

// =============================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ outputs:
default:
type: elasticsearch
hosts: [127.0.0.1:9200]
username: elastic
password: changeme
apikey: <my-api-key>

providers:
local_dynamic:
Expand Down Expand Up @@ -98,11 +97,10 @@ inputs:
type: logfile
outputs:
default:
apikey: <my-api-key>
hosts:
- 127.0.0.1:9200
password: changeme
type: elasticsearch
username: elastic
providers:
local_dynamic:
items:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ To create an API key for {agent}:
+
In a {serverless-short} environment, in {kib} navigate to *Project settings* > *Management* > *API keys* and click *Create API key*.

. Enter a name for your API key and select *Restrict privileges*. In the role
descriptors box, copy and paste the following JSON. This example creates an
API key with privileges for ingesting logs, metrics, traces, and synthetics:
. Enter a name for your API key and select *Restrict privileges* (in a {serverless-short} environment, *Control security privileges*).

. In the role descriptors box, copy and paste the following JSON. This example creates an API key with privileges for ingesting logs, metrics, traces, and synthetics:
+
[source,json]
----
Expand Down