Skip to content

Commit 9beead5

Browse files
authored
Document list-search template function in syslog-ng
Added documentation for the list-search template function, including syntax, description, and available options. Signed-off-by: Hofi <hofione@gmail.com>
1 parent 96412a4 commit 9beead5

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

doc/_admin-guide/110_Template_and_rewrite/000_Customize_message_format/007_Template_functions_of_syslog-ng.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,23 @@ second element, and so on.
743743
if the ${mylist} list contains the one, two, three elements, then
744744
$(list-tail ${mylist} ) returns two, three.
745745

746+
### $(list-search)
747+
748+
| *Syntax:* | $(list-search [OPTIONS] <pattern> ${list} ) |
749+
750+
*Description:* The `list-search` template function scans the elements of ${list} starting from
751+
the given start_index and returns the index of the first element that matches <pattern>.
752+
753+
**NOTE:** Indexing starts at 0. If <pattern> is not found, the function returns an empty string.
754+
{: .notice--info}
755+
756+
Available options:
757+
758+
- --mode MODE\
759+
Specifies the matching mode. Possible values are: literal (default), prefix, substring, glob, pcre
760+
- --start-index N\
761+
Skips the first N elements of ${list}
762+
746763
### $(list-slice)
747764

748765
| *Syntax:* | $(list-slice \<from\>:\<to\> ${list} ) |

0 commit comments

Comments
 (0)