Skip to content

Commit ed3f741

Browse files
kilfoylemergify[bot]
authored andcommitted
Fix examples to use API key authentication (#924)
(cherry picked from commit 52fddd0)
1 parent 576dd32 commit ed3f741

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

docs/en/ingest-management/elastic-agent/configuration/outputs/output-elasticsearch.asciidoc

+4-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ outputs:
2626
password: changeme
2727
----
2828

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

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

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

212214
|===
@@ -234,7 +236,7 @@ outputs:
234236

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

240242
// =============================================================================

docs/en/ingest-management/elastic-agent/elastic-agent-debug-input-configs.asciidoc

+2-4
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ outputs:
1515
default:
1616
type: elasticsearch
1717
hosts: [127.0.0.1:9200]
18-
username: elastic
19-
password: changeme
18+
apikey: <my-api-key>
2019
2120
providers:
2221
local_dynamic:
@@ -98,11 +97,10 @@ inputs:
9897
type: logfile
9998
outputs:
10099
default:
100+
apikey: <my-api-key>
101101
hosts:
102102
- 127.0.0.1:9200
103-
password: changeme
104103
type: elasticsearch
105-
username: elastic
106104
providers:
107105
local_dynamic:
108106
items:

docs/en/ingest-management/elastic-agent/grant-access-to-elasticsearch.asciidoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ To create an API key for {agent}:
4040
+
4141
In a {serverless-short} environment, in {kib} navigate to *Project settings* > *Management* > *API keys* and click *Create API key*.
4242

43-
. Enter a name for your API key and select *Restrict privileges*. In the role
44-
descriptors box, copy and paste the following JSON. This example creates an
45-
API key with privileges for ingesting logs, metrics, traces, and synthetics:
43+
. Enter a name for your API key and select *Restrict privileges* (in a {serverless-short} environment, *Control security privileges*).
44+
45+
. 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:
4646
+
4747
[source,json]
4848
----

0 commit comments

Comments
 (0)