From 49d3d48a786f6bf5419b67253ed60cae734289c7 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Tue, 28 May 2024 18:15:19 +0100 Subject: [PATCH] chore: [release-3.0.x] docs: Update template_functions.md (#13052) Co-authored-by: Pangidoan Butar <38452094+doanbutar@users.noreply.github.com> --- docs/sources/query/template_functions.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/sources/query/template_functions.md b/docs/sources/query/template_functions.md index 0effe4c01ac7..9ba67620a488 100644 --- a/docs/sources/query/template_functions.md +++ b/docs/sources/query/template_functions.md @@ -303,12 +303,12 @@ Example: Use this function to test to see if one string is contained inside of another. -Signature: `contains(s string, src string) bool` +Signature: `contains(src string, s string,) bool` Examples: ```template -{{ if contains .err "ErrTimeout" }} timeout {{end}} +{{ if contains "ErrTimeout" .err }} timeout {{end}} {{ if contains "he" "hello" }} yes {{end}} ``` @@ -316,13 +316,13 @@ Examples: Use this function to test to see if one string has exact matching inside of another. -Signature: `eq(s string, src string) bool` +Signature: `eq(src string, s string) bool` Examples: ```template -{{ if eq .err "ErrTimeout" }} timeout {{end}} -{{ if eq "he" "hello" }} yes {{end}} +{{ if eq "ErrTimeout" .err}} timeout {{end}} +{{ if eq "hello" "hello" }} yes {{end}} ``` ## hasPrefix and hasSuffix