From 64adf798c6a51684f8f6ab520b72dd69ba2842f3 Mon Sep 17 00:00:00 2001 From: Benson Fung Date: Wed, 4 Dec 2024 19:41:10 -0800 Subject: [PATCH 1/4] docs(vrl): add example syntax for valid expressions. --- .../reference/remap/syntax/expressions.cue | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 website/cue/reference/remap/syntax/expressions.cue diff --git a/website/cue/reference/remap/syntax/expressions.cue b/website/cue/reference/remap/syntax/expressions.cue new file mode 100644 index 0000000000000..a4863e80951ed --- /dev/null +++ b/website/cue/reference/remap/syntax/expressions.cue @@ -0,0 +1,20 @@ +package metadata + +remap: syntax: expressions: { + title: "Expressions" + description: """ + VRL programs are made up of literal and dynamic expressions, described more in detail below. Expressions can be sparated by newline, or by using a semicolon. + """ + + examples: [ + """ + # newline delimited expressions + del(.user_info) + .timestamp = now() + """, + """ + # semicolon delimited expressions + del(.user_info); .timestamp = now() + """ + ] +} From 4eaf93733de9f14058665108d64d0ddf6ea086a5 Mon Sep 17 00:00:00 2001 From: Benson Fung Date: Wed, 4 Dec 2024 20:04:47 -0800 Subject: [PATCH 2/4] fix spelling --- website/cue/reference/remap/syntax/expressions.cue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/cue/reference/remap/syntax/expressions.cue b/website/cue/reference/remap/syntax/expressions.cue index a4863e80951ed..fbc222fecac47 100644 --- a/website/cue/reference/remap/syntax/expressions.cue +++ b/website/cue/reference/remap/syntax/expressions.cue @@ -3,7 +3,7 @@ package metadata remap: syntax: expressions: { title: "Expressions" description: """ - VRL programs are made up of literal and dynamic expressions, described more in detail below. Expressions can be sparated by newline, or by using a semicolon. + VRL programs are made up of literal and dynamic expressions, described more in detail below. Expressions can be separated by newline, or by using a semicolon. """ examples: [ From 9c334a1cb98a700c969967359e7b890bdebe4546 Mon Sep 17 00:00:00 2001 From: Benson Fung Date: Wed, 4 Dec 2024 20:22:15 -0800 Subject: [PATCH 3/4] fix grammar and trailing whitespace from 'cargo vdev check fmt' --- website/cue/reference/remap/syntax/expressions.cue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/website/cue/reference/remap/syntax/expressions.cue b/website/cue/reference/remap/syntax/expressions.cue index fbc222fecac47..4f123f64462b7 100644 --- a/website/cue/reference/remap/syntax/expressions.cue +++ b/website/cue/reference/remap/syntax/expressions.cue @@ -3,18 +3,20 @@ package metadata remap: syntax: expressions: { title: "Expressions" description: """ - VRL programs are made up of literal and dynamic expressions, described more in detail below. Expressions can be separated by newline, or by using a semicolon. + VRL programs are made up of literal and dynamic expressions, described more in detail below. Expressions can be separated by newline or semicolon in any combination. """ examples: [ """ - # newline delimited expressions + # newline delimited expressions del(.user_info) - .timestamp = now() + .timestamp = now() + .message = "hello world" """, """ # semicolon delimited expressions del(.user_info); .timestamp = now() + .message = "hello world" """ ] } From 14ac38d87ae7c6d9cb35394ab13f22def54eec6b Mon Sep 17 00:00:00 2001 From: Benson Fung Date: Wed, 4 Dec 2024 20:46:47 -0800 Subject: [PATCH 4/4] run 'cue fmt' to pass 'make check-docs' --- .../cue/reference/remap/syntax/expressions.cue | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/website/cue/reference/remap/syntax/expressions.cue b/website/cue/reference/remap/syntax/expressions.cue index 4f123f64462b7..66de53b92496d 100644 --- a/website/cue/reference/remap/syntax/expressions.cue +++ b/website/cue/reference/remap/syntax/expressions.cue @@ -8,15 +8,15 @@ remap: syntax: expressions: { examples: [ """ - # newline delimited expressions - del(.user_info) - .timestamp = now() - .message = "hello world" - """, - """ - # semicolon delimited expressions - del(.user_info); .timestamp = now() - .message = "hello world" + # newline delimited expressions + del(.user_info) + .timestamp = now() + .message = "hello world" + """, """ + # semicolon delimited expressions + del(.user_info); .timestamp = now() + .message = "hello world" + """, ] }