From c75916e0f60c01aabaf13830e4792aa2afeded18 Mon Sep 17 00:00:00 2001 From: Shin Seunghun Date: Mon, 24 Feb 2025 23:14:41 +0900 Subject: [PATCH] docs(website): fix incorrect example about the `contains` function The `contains` function is now infallible and always returns a boolean value. This commit fixes the example in the `transformation` guide. --- website/content/en/guides/level-up/transformation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/content/en/guides/level-up/transformation.md b/website/content/en/guides/level-up/transformation.md index 98db0049d9f73..a324502bbbc20 100644 --- a/website/content/en/guides/level-up/transformation.md +++ b/website/content/en/guides/level-up/transformation.md @@ -138,8 +138,8 @@ transforms: # If the log message contains the phrase "Great Scott!", set the new field # "critical" to true, otherwise set it to false. If the "contains" function # errors, log the error (instead of aborting the script, as above). - if (is_critical, err = contains(.message, "Great Scott!"); err != null) { - log(err, level: "error") + if (is_critical = contains(.message, "Great Scott!"); is_critical) { + log("It contains 'Great Scott!'", level: "info") } .critical = is_critical