From ee98c5fe90e990f9740e9349028d234be8ee877b Mon Sep 17 00:00:00 2001 From: Paschalis Tsilias Date: Wed, 10 Jan 2024 22:30:10 +0200 Subject: [PATCH] loki.process: document limitation of stage.json (#6082) * loki.process: document limitation of stage.json Signed-off-by: Paschalis Tsilias * Add example error for future grepping Signed-off-by: Paschalis Tsilias * Apply Clayton's suggestions Signed-off-by: Paschalis Tsilias --------- Signed-off-by: Paschalis Tsilias Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com> --- .../flow/reference/components/loki.process.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/sources/flow/reference/components/loki.process.md b/docs/sources/flow/reference/components/loki.process.md index c2793abbfe2e..d1c8ef723bd9 100644 --- a/docs/sources/flow/reference/components/loki.process.md +++ b/docs/sources/flow/reference/components/loki.process.md @@ -382,6 +382,20 @@ following key-value pair to the set of extracted data. username: agent ``` +{{% admonition type="note" %}} +Due to a limitation of the upstream jmespath library, you must wrap any string +that contains a hyphen `-` in quotes so that it's not considered a numerical +expression. + +If you don't use quotes to wrap a string that contains a hyphen, you will get +errors like: `Unexpected token at the end of the expression: tNumber` + +You can use one of two options to circumvent this issue: + +1. An escaped double quote. For example: `http_user_agent = "\"request_User-Agent\""` +1. A backtick quote. For example: ``http_user_agent = `"request_User-Agent"` `` +{{% /admonition %}} + ### stage.label_drop block The `stage.label_drop` inner block configures a processing stage that drops labels