diff options
author | John Thacker <johnthacker@gmail.com> | 2024-02-18 19:47:08 -0500 |
---|---|---|
committer | John Thacker <johnthacker@gmail.com> | 2024-03-09 14:31:15 +0000 |
commit | c2e95293d21286b99edd7db390e26b437e34c9e6 (patch) | |
tree | 8899efe478a463afff3432f7be5d98f92c2d2c9c /docbook/wsug_src | |
parent | 4d57ab349894e802fa666fdb90fc388d431cfc27 (diff) |
dfilter: Add vals (value string) function
Add a function to explicitly convert a field from its value to
the value string output. We do this implicitly with some filters
(i.e., comparing an integer type with a value string to a string),
but having an explicit function allows it to be nested with other
functions and operators, or used for custom fields.
Diffstat (limited to 'docbook/wsug_src')
-rw-r--r-- | docbook/wsug_src/wsug_work.adoc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/docbook/wsug_src/wsug_work.adoc b/docbook/wsug_src/wsug_work.adoc index 60e4dd012f..bd9220008b 100644 --- a/docbook/wsug_src/wsug_work.adoc +++ b/docbook/wsug_src/wsug_work.adoc @@ -956,6 +956,7 @@ The display filter language has a number of functions to convert fields, see |len |Returns the byte length of a string or bytes field. |count |Returns the number of field occurrences in a frame. |string |Converts a non-string field to a string. +|vals |Converts a field value to its value string, if it has one. |dec |Converts an unsigned integer field to a decimal string. |hex |Converts an unsigned integer field to a hexadecimal string. |max |Return the maximum value for the arguments. @@ -989,6 +990,9 @@ To match IP addresses ending in 255 in a block of subnets (172.16 to 172.31): string(ip.dst) matches r"^172\.(1[6-9]|2[0-9]|3[0-1])\.[0-9]{1,3}\.255" ---- +The `vals` function converts an integer or boolean field value to a string +using the field's associated value string, if it has one. + The functions max() and min() take any number of arguments of the same type and returns the largest/smallest respectively of the set. |