Skip to content

Commit

Permalink
Fix examples to use API key authentication (#924)
Browse files Browse the repository at this point in the history
(cherry picked from commit 52fddd0)
  • Loading branch information
kilfoyle authored and mergify[bot] committed Feb 15, 2024
1 parent 60a6208 commit a4afc0d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
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

0 comments on commit a4afc0d

Please sign in to comment.