Skip to content

Commit

Permalink
add information on beats api key
Browse files Browse the repository at this point in the history
  • Loading branch information
colleenmcginnis committed Dec 11, 2024
1 parent e4eabab commit 5289b20
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 15 deletions.
4 changes: 3 additions & 1 deletion docs/en/observability/apm/configure/agent-config.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ Here's a sample configuration:
[source,yaml]
----
apm-server.agent.config.cache.expiration: 45s
apm-server.agent.config.elasticsearch.api_key: TiNAGG4BaaMdaH1tRfuU:KnR6yE41RrSowb0kQ0HWoA
apm-server.agent.config.elasticsearch.api_key: TiNAGG4BaaMdaH1tRfuU:KnR6yE41RrSowb0kQ0HWoA <1>
----
<1> {blank}
include::./outputs/elasticsearch.asciidoc[tag=configure-beats]

[float]
== APM agent configuration options
Expand Down
12 changes: 10 additions & 2 deletions docs/en/observability/apm/configure/outputs/elasticsearch.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ output.elasticsearch:
----
output.elasticsearch:
hosts: ["https://myEShost:9200"]
api_key: "ZCV7VnwBgnX0T19fN8Qe:KnR6yE41RrSowb0kQ0HWoA"
api_key: "ZCV7VnwBgnX0T19fN8Qe:KnR6yE41RrSowb0kQ0HWoA" <1>
----
<1> {blank}
include::elasticsearch.asciidoc[tag=configure-beats]

*PKI certificate authentication:*

Expand Down Expand Up @@ -128,7 +130,13 @@ The default value is `false`.
Instead of using a username and password, you can use 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`.

See <<apm-beats-api-keys>> for more information.
// tag::configure-beats[]
You _must_ set the API key to be configured to *Beats*.
Base64 encoded API keys are not currently supported in this configuration.
For details on how to create and configure a compatible API key, refer to <<apm-beats-api-key-publish>>.
// end::configure-beats[]

image::images/apm-api-key-beats.png[API key dropdown highlighting the Beats option]

[float]
==== `username`
Expand Down
2 changes: 1 addition & 1 deletion docs/en/observability/apm/https.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ output.elasticsearch:
api_key: "KnR6yE41RrSowb0kQ0HWoA" <1>
----------------------------------------------------------------------
<1> This API key must have the privileges required to publish events to {es}.
To create an API key like this, see <<apm-beats-api-keys>>.
include::./configure/outputs/elasticsearch.asciidoc[tag=configure-beats]
--

[[apm-beats-tls]]
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ You can create as many API keys per user as necessary.
[[apm-beats-api-key-publish]]
== Create an API key for writing events

To open **API keys**, find **Stack Management** in the main menu or use the {kibana-ref}/introduction.html#kibana-navigation-search[global search field].
Click **Create API key**.
To create an API key:

. Go to **Stack Management** in the main menu and find **API Keys** or use the {kibana-ref}/introduction.html#kibana-navigation-search[global search field].
. Click **Create API key**.
+
[role="screenshot"]
image::images/server-api-key-create.png[API key creation]

Enter a name for your API key and select **Restrict privileges**.
+
. Enter a name for your API key and select **Restrict privileges**.
In the role descriptors box, assign the appropriate privileges to the new API key. For example:

+
[source,json,subs="attributes,callouts"]
----
{
Expand Down Expand Up @@ -57,16 +59,19 @@ In the role descriptors box, assign the appropriate privileges to the new API ke
}
}
----

+
NOTE: This example only provides privileges for **writing data**.
See <<apm-feature-roles>> for additional privileges and information.

To set an expiration date for the API key, select **Expire after time**
+
. To set an expiration date for the API key, select **Expire after time**
and input the lifetime of the API key in days.
. Click **Create API key**.
. {blank}
include::../../configure/outputs/elasticsearch.asciidoc[tag=configure-beats]
+
image::images/apm-api-key-beats.png[API key dropdown highlighting the Beats option]

Click **Create API key**. In the dropdown, switch to **{beats}** and copy the API key.

You can now use this API key in your +apm-server.yml+ configuration file:
You can now use this API key in your `apm-server.yml` configuration file:

["source","yml",subs="attributes"]
--------------------
Expand Down

0 comments on commit 5289b20

Please sign in to comment.