Skip to content
2 changes: 2 additions & 0 deletions reference/fleet/agent-provider.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
mapped_pages:
- https://www.elastic.co/guide/en/fleet/current/agent-provider.html
applies_to:
stack: ga
products:
- id: fleet
- id: elastic-agent
Expand Down
4 changes: 3 additions & 1 deletion reference/fleet/docker-provider.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
---
mapped_pages:
- https://www.elastic.co/guide/en/fleet/current/docker-provider.html
applies_to:
stack: ga
products:
- id: fleet
- id: elastic-agent
---

# Docker Provider [docker-provider]
# Docker provider [docker-provider]

Provides inventory information from Docker. The available dynamic variables are:

Expand Down
4 changes: 3 additions & 1 deletion reference/fleet/env-provider.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
---
mapped_pages:
- https://www.elastic.co/guide/en/fleet/current/env-provider.html
applies_to:
stack: ga
products:
- id: fleet
- id: elastic-agent
---

# Env Provider [env-provider]
# Env provider [env-provider]

Provides access to the environment variables as key-value pairs.

Expand Down
8 changes: 8 additions & 0 deletions reference/fleet/filesource-provider.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
---
applies_to:
stack: ga
products:
- id: fleet
- id: elastic-agent
---

# Filesource provider [filesource-provider]

Watches for changes of specified files and updates the values of the variables when the content of the files changes.
Expand Down
2 changes: 2 additions & 0 deletions reference/fleet/host-provider.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
mapped_pages:
- https://www.elastic.co/guide/en/fleet/current/host-provider.html
applies_to:
stack: ga
products:
- id: fleet
- id: elastic-agent
Expand Down
4 changes: 3 additions & 1 deletion reference/fleet/kubernetes-provider.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
---
mapped_pages:
- https://www.elastic.co/guide/en/fleet/current/kubernetes-provider.html
applies_to:
stack: ga
products:
- id: fleet
- id: elastic-agent
---

# Kubernetes Provider [kubernetes-provider]
# Kubernetes provider [kubernetes-provider]

Provides inventory information from Kubernetes.

Expand Down
2 changes: 2 additions & 0 deletions reference/fleet/kubernetes_leaderelection-provider.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
mapped_pages:
- https://www.elastic.co/guide/en/fleet/current/kubernetes_leaderelection-provider.html
applies_to:
stack: ga
products:
- id: fleet
- id: elastic-agent
Expand Down
4 changes: 3 additions & 1 deletion reference/fleet/kubernetes_secrets-provider.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
---
mapped_pages:
- https://www.elastic.co/guide/en/fleet/current/kubernetes_secrets-provider.html
applies_to:
stack: ga
products:
- id: fleet
- id: elastic-agent
---

# Kubernetes Secrets Provider [kubernetes_secrets-provider]
# Kubernetes Secrets provider [kubernetes_secrets-provider]

Provides access to the Kubernetes Secrets API.

Expand Down
2 changes: 2 additions & 0 deletions reference/fleet/local-dynamic-provider.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
mapped_pages:
- https://www.elastic.co/guide/en/fleet/current/local-dynamic-provider.html
applies_to:
stack: ga
products:
- id: fleet
- id: elastic-agent
Expand Down
4 changes: 3 additions & 1 deletion reference/fleet/local-provider.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
---
mapped_pages:
- https://www.elastic.co/guide/en/fleet/current/local-provider.html
applies_to:
stack: ga
products:
- id: fleet
- id: elastic-agent
---

# Local [local-provider]
# Local provider [local-provider]

Provides custom keys to use as variables. For example:

Expand Down
69 changes: 39 additions & 30 deletions reference/fleet/providers.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,42 @@
---
navigation_title: Providers
navigation_title: Agent providers
mapped_pages:
- https://www.elastic.co/guide/en/fleet/current/providers.html
applies_to:
stack: ga
products:
- id: fleet
- id: elastic-agent
---

# Configure providers for standalone {{agent}}s [providers]
# {{agent}} providers [providers]


Providers supply the key-value pairs that are used for variable substitution and conditionals. Each providers keys are automatically prefixed with the name of the provider in the context of the {{agent}}.
Providers supply the key-value pairs that are used for variable substitution and conditionals. Each provider's keys are automatically prefixed with the name of the provider in the context of the {{agent}}.

For example, a provider named `foo` provides `{"key1": "value1", "key2": "value2"}`, the key-value pairs are placed in `{"foo" : {"key1": "value1", "key2": "value2"}}`. To reference the keys, use `{{foo.key1}}` and `{{foo.key2}}`.
For example, if a provider named `foo` provides `{"key1": "value1", "key2": "value2"}`, the key-value pairs are placed in `{"foo" : {"key1": "value1", "key2": "value2"}}`. To reference the keys, use the variables `${foo.key1}` and `${foo.key2}`.


## Provider configuration [_provider_configuration]
## Provider usage by deployment model [provider_usage_by_deployment_model]

The provider configuration is specified under the top-level `providers` key in the `elastic-agent.yml` configuration. All registered providers are enabled by default. If a provider cannot connect, no mappings are produced.
How you use providers depends on whether you're running a standalone or a {{fleet}}-managed {{agent}}.

The following example shows two providers (`local` and `local_dynamic`) that supply custom keys:
### Using providers on standalone {{agent}} [using-providers-standalone-agent]

On standalone {{agent}}, providers can be configured through the `providers` key in the `elastic-agent.yml` configuration file. You can enable, disable, and configure provider settings as needed. For more details, refer to [Provider configuration](#provider_configuration).

### Using providers on {{fleet}}-managed {{agent}} [using-providers-fleet-managed-agent]

On {{fleet}}-managed {{agent}}, you can use provider variables in integration policy settings (for example, `${host.name}`, `${env.foo}`, `${agent.id}`), but you cannot add a `providers` configuration block directly through the {{fleet}} UI.

Some providers can be configured on {{k8s}} deployments using ConfigMaps. For more details, refer to [Advanced {{agent}} configuration managed by {{fleet}}](/reference/fleet/advanced-kubernetes-managed-by-fleet.md).


## Provider configuration [provider_configuration]

On standalone {{agent}}, provider configuration is specified under the top-level `providers` key in the `elastic-agent.yml` configuration. All registered providers are enabled by default. If a provider cannot connect, no mappings are produced.

The following example shows two providers (`local` and `local_dynamic`) that supply custom keys on a standalone {{agent}}:

```yaml
providers:
Expand All @@ -38,6 +55,8 @@ providers:

Providers are enabled automatically if a provider is referenced in an {{agent}} policy. All providers are prefixed without name collisions. The name of the provider is in the key in the configuration.

For example, to disable the Docker provider in a standalone {{agent}}:

```yaml
providers:
docker:
Expand All @@ -53,34 +72,34 @@ Context providers give the current context of the running {{agent}}, for example

They can only provide a single key-value mapping. Think of them as singletons; an update of a key-value mapping results in a re-evaluation of the entire configuration. These providers are normally very static, but not required. A value can change which results in re-evaluation.

Context providers use the Elastic Common Schema (ECS) naming to ensure consistency and understanding throughout documentation and projects.
Context providers use the {{product.ecs}} naming to ensure consistency and understanding throughout documentation and projects.

{{agent}} supports the following context providers:

* [Local](/reference/fleet/local-provider.md)
* [Agent Provider](/reference/fleet/agent-provider.md)
* [Host Provider](/reference/fleet/host-provider.md)
* [Env Provider](/reference/fleet/env-provider.md)
* [Kubernetes Secrets Provider](/reference/fleet/kubernetes_secrets-provider.md)
* [Kubernetes Leader Election Provider](/reference/fleet/kubernetes_leaderelection-provider.md)
* [Local provider](/reference/fleet/local-provider.md)
* [Agent provider](/reference/fleet/agent-provider.md)
* [Host provider](/reference/fleet/host-provider.md)
* [Env provider](/reference/fleet/env-provider.md)
* [Kubernetes Secrets provider](/reference/fleet/kubernetes_secrets-provider.md)
* [Kubernetes LeaderElection provider](/reference/fleet/kubernetes_leaderelection-provider.md)


### Dynamic Providers [dynamic-providers]
### Dynamic providers [dynamic-providers]

Dynamic providers give an array of multiple key-value mappings. Each key-value mapping is combined with the previous context provider’s key and value mapping which provides a new unique mapping that is used to generate a configuration.

{{agent}} supports the following context providers:

* [Local Dynamic Provider](/reference/fleet/local-dynamic-provider.md)
* [Docker Provider](/reference/fleet/docker-provider.md)
* [Kubernetes Provider](/reference/fleet/kubernetes-provider.md)
* [Local dynamic provider](/reference/fleet/local-dynamic-provider.md)
* [Docker provider](/reference/fleet/docker-provider.md)
* [Kubernetes provider](/reference/fleet/kubernetes-provider.md)


### Disabling Providers By Default [disable-providers-by-default]
### Disabling providers by default [disable-providers-by-default]

All registered providers are disabled by default until they are referenced in a policy.

You can disable all providers even if they are referenced in a policy by setting `agent.providers.initial_default: false`.
On standalone {{agent}}, you can disable all providers even if they are referenced in a policy by setting `agent.providers.initial_default: false`.

The following configuration disables all providers from running except for the docker provider, if it becomes referenced in the policy:

Expand All @@ -90,13 +109,3 @@ providers:
docker:
enabled: true
```










24 changes: 12 additions & 12 deletions reference/fleet/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,6 @@ toc:
- file: elastic-agent-simplified-input-configuration.md
- file: elastic-agent-inputs-list.md
- file: dynamic-input-configuration.md
- file: providers.md
children:
- file: local-provider.md
- file: agent-provider.md
- file: host-provider.md
- file: env-provider.md
- file: filesource-provider.md
- file: kubernetes_secrets-provider.md
- file: kubernetes_leaderelection-provider.md
- file: local-dynamic-provider.md
- file: docker-provider.md
- file: kubernetes-provider.md
- file: elastic-agent-output-configuration.md
children:
- file: elasticsearch-output.md
Expand Down Expand Up @@ -163,6 +151,18 @@ toc:
- file: data-streams-advanced-features.md
- file: alert-templates.md
- file: agent-command-reference.md
- file: providers.md
children:
- file: local-provider.md
- file: agent-provider.md
- file: host-provider.md
- file: env-provider.md
- file: filesource-provider.md
- file: kubernetes_secrets-provider.md
- file: kubernetes_leaderelection-provider.md
- file: local-dynamic-provider.md
- file: docker-provider.md
- file: kubernetes-provider.md
- file: agent-processors.md
children:
- file: processor-syntax.md
Expand Down
Loading