Skip to content

Commit da31345

Browse files
Doc: Update docs for testing for boolean fields (#18271) (#18292)
(cherry picked from commit 8f4014b) Co-authored-by: Karen Metts <[email protected]>
1 parent bf6cf7b commit da31345

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/reference/tips-best-practices.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,15 @@ filter {
6060
# we use a "temporal" field with a predefined arbitrary known value that
6161
# lives only in filtering stage.
6262
add_field => { "[@metadata][test_field_check]" => "a null value" }
63+
}
6364

65+
filter {
66+
mutate {
6467
# we copy the field of interest into that temporal field.
6568
# If the field doesn't exist, copy is not executed.
6669
copy => { "test_field" => "[@metadata][test_field_check]" }
6770
}
6871

69-
7072
# now we now if testField didn't exists, our field will have
7173
# the initial arbitrary value
7274
if [@metadata][test_field_check] == "a null value" {

0 commit comments

Comments
 (0)