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

[8.15](backport #4184) Add docs on how to opt-out of complex object parsing #4197

Merged
merged 1 commit into from
Aug 23, 2024
Merged
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
27 changes: 25 additions & 2 deletions docs/en/observability/apm/configure/env.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ usage in the shell. Arrays at the top-level do not require brackets (`[]`).

For example, the following environment variable is set to a list:

[source,yaml]
[source,bash]
-------------------------------------------------------------------------------
ES_HOSTS="10.45.3.2:9220,10.45.3.1:9230"
-------------------------------------------------------------------------------
Expand All @@ -95,4 +95,27 @@ output.elasticsearch:
When APM Server loads the config file, it resolves the environment variable and
replaces it with the specified list before reading the `hosts` setting.

NOTE: Do not use double-quotes (`"`) to wrap regular expressions, or the backslash (`\`) will be interpreted as an escape character.
[float]
=== Opt-out of complex object parsing

To opt-out of this complex object parsing behavior such that the environment variable
is always parsed as a string, wrap the environment variable in double-quotes (`"`),
and escape all double quotes within them.

For example, given the following config:

[source,yaml]
-------------------------------------------------------------------------------
output.elasticsearch:
password: '${ES_PASSWORD}'
-------------------------------------------------------------------------------

If the intended password is `foo,bar"baz`, to avoid parsing errors due to complex object parsing, the environment variable should be set as follows:

[source,bash]
-------------------------------------------------------------------------------
ES_PASSWORD='"foo,bar\"baz"'
-------------------------------------------------------------------------------


NOTE: Do not use double-quotes (`"`) to wrap regular expressions. Otherwise, the backslash (`\`) will be interpreted as an escape character.