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

Fix local_dynamic documentation and add providers inline doc. #22657

Merged
merged 3 commits into from
Dec 1, 2020
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
2 changes: 2 additions & 0 deletions x-pack/elastic-agent/_meta/config/common.p2.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,5 @@ agent.logging.to_stderr: true
# information. Recommended to use in combination with `logging.json=true`
# Defaults to false.
#agent.logging.ecs: false

{{template "providers.yml.tmpl" .}}
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,5 @@ agent.logging.to_stderr: true
# information. Recommended to use in combination with `logging.json=true`
# Defaults to false.
#agent.logging.ecs: false

{{template "providers.yml.tmpl" .}}
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,5 @@ agent.logging.to_stderr: true
# information. Recommended to use in combination with `logging.json=true`
# Defaults to false.
#agent.logging.ecs: false

{{template "providers.yml.tmpl" .}}
42 changes: 42 additions & 0 deletions x-pack/elastic-agent/_meta/config/providers.yml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Providers

# Providers supply the key/values pairs that are used for variable substitution
# and conditionals. Each provider's keys are automatically prefixed with the name
# of the provider.

#providers:

# Agent provides information about the running agent.
# agent:
# enabled: true

# Docker provides inventory information from Docker.
# docker:
# enabled: true
# host: "unix:///var/run/docker.sock"
# cleanup_timeout: 60

# Env providers information about the running environment.
# env:
# enabled: true

# Host provides information about the current host.
# host:
# enabled: true

# Local provides custom keys to use as variable.
# local:
# enabled: true
# vars:
# foo: bar

# Local dynamic allows you to define multiple key/values to generate multiple configurations.
# local_dynamic:
# enabled: true
# items:
# - vars:
# my_var: key1
# - vars:
# my_var: key2
# - vars:
# my_var: key3
24 changes: 16 additions & 8 deletions x-pack/elastic-agent/docs/elastic-agent-providers.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,18 @@ defines 3 values for `item`:
----
inputs:
- type: logfile
paths: "/var/${item}/app.log"
streams:
- paths: "/var/${local_dynamic.my_var}/app.log"

providers:
vars:
- item: key1
- item: key2
- item: key3
local_dynamic:
items:
- vars:
my_var: key1
- vars:
my_var: key2
- vars:
my_var: key3
----

The configuration generated by this policy looks like:
Expand All @@ -187,11 +192,14 @@ The configuration generated by this policy looks like:
----
inputs:
- type: logfile
paths: "/var/key1/app.log"
streams:
- paths: "/var/key1/app.log"
- type: logfile
paths: "/var/key2/app.log"
streams:
- paths: "/var/key2/app.log"
- type: logfile
paths: "/var/key3/app.log"
streams:
- paths: "/var/key3/app.log"
----

[[docker-provider]]
Expand Down
44 changes: 44 additions & 0 deletions x-pack/elastic-agent/elastic-agent.docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,47 @@ agent.logging.to_stderr: true
# information. Recommended to use in combination with `logging.json=true`
# Defaults to false.
#agent.logging.ecs: false

# Providers

# Providers supply the key/values pairs that are used for variable substitution
# and conditionals. Each provider's keys are automatically prefixed with the name
# of the provider.

#providers:

# Agent provides information about the running agent.
# agent:
# enabled: true

# Docker provides inventory information from Docker.
# docker:
# enabled: true
# host: "unix:///var/run/docker.sock"
# cleanup_timeout: 60

# Env providers information about the running environment.
# env:
# enabled: true

# Host provides information about the current host.
# host:
# enabled: true

# Local provides custom keys to use as variable.
# local:
# enabled: true
# vars:
# foo: bar

# Local dynamic allows you to define multiple key/values to generate multiple configurations.
# local_dynamic:
# enabled: true
# items:
# - vars:
# my_var: key1
# - vars:
# my_var: key2
# - vars:
# my_var: key3

44 changes: 44 additions & 0 deletions x-pack/elastic-agent/elastic-agent.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,47 @@ agent.logging.to_stderr: true
# Defaults to false.
#agent.logging.ecs: false

# Providers

# Providers supply the key/values pairs that are used for variable substitution
# and conditionals. Each provider's keys are automatically prefixed with the name
# of the provider.

#providers:

# Agent provides information about the running agent.
# agent:
# enabled: true

# Docker provides inventory information from Docker.
# docker:
# enabled: true
# host: "unix:///var/run/docker.sock"
# cleanup_timeout: 60

# Env providers information about the running environment.
# env:
# enabled: true

# Host provides information about the current host.
# host:
# enabled: true

# Local provides custom keys to use as variable.
# local:
# enabled: true
# vars:
# foo: bar

# Local dynamic allows you to define multiple key/values to generate multiple configurations.
# local_dynamic:
# enabled: true
# items:
# - vars:
# my_var: key1
# - vars:
# my_var: key2
# - vars:
# my_var: key3


44 changes: 44 additions & 0 deletions x-pack/elastic-agent/elastic-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,47 @@ agent.logging.to_stderr: true
# Defaults to false.
#agent.logging.ecs: false

# Providers

# Providers supply the key/values pairs that are used for variable substitution
# and conditionals. Each provider's keys are automatically prefixed with the name
# of the provider.

#providers:

# Agent provides information about the running agent.
# agent:
# enabled: true

# Docker provides inventory information from Docker.
# docker:
# enabled: true
# host: "unix:///var/run/docker.sock"
# cleanup_timeout: 60

# Env providers information about the running environment.
# env:
# enabled: true

# Host provides information about the current host.
# host:
# enabled: true

# Local provides custom keys to use as variable.
# local:
# enabled: true
# vars:
# foo: bar

# Local dynamic allows you to define multiple key/values to generate multiple configurations.
# local_dynamic:
# enabled: true
# items:
# - vars:
# my_var: key1
# - vars:
# my_var: key2
# - vars:
# my_var: key3