From 923fd4011be3dbb9e0b1185bf90fb5b66177ee31 Mon Sep 17 00:00:00 2001 From: Eldar Nash <136102326+eldarnash@users.noreply.github.com> Date: Tue, 8 Aug 2023 20:55:48 +0200 Subject: [PATCH] Sdata parser (#15) * Typo fix * [4.1] Adds minimal sdata-parser docs * Minor fixes --- content/chapter-parsers/date-parser/_index.md | 2 +- .../chapter-parsers/sdata-parser/_index.md | 24 +++++++++++++++++++ .../headless/chunk/option-parser-template.md | 2 +- 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 content/chapter-parsers/sdata-parser/_index.md diff --git a/content/chapter-parsers/date-parser/_index.md b/content/chapter-parsers/date-parser/_index.md index eb065c9a..82bea8f3 100644 --- a/content/chapter-parsers/date-parser/_index.md +++ b/content/chapter-parsers/date-parser/_index.md @@ -19,7 +19,7 @@ Note that parsing will fail if the format string does not match the entire templ parser parser_name { date-parser( format("") - template("'") + template("") ); }; ``` diff --git a/content/chapter-parsers/sdata-parser/_index.md b/content/chapter-parsers/sdata-parser/_index.md new file mode 100644 index 00000000..a870c004 --- /dev/null +++ b/content/chapter-parsers/sdata-parser/_index.md @@ -0,0 +1,24 @@ +--- +title: "Structured data (SDATA) parser" +weight: 1850 +--- + + +Available in {{% param "product.abbrev" %}} 4.1 and later. + +The `sdata-parser()` allows you to parse an RFC5424-style structured data string. You can use it to parse this relatively complex format separately, for example, to process malformatted messages. You can use the optional `prefix` option to add a specific string before the names of the parsed name-value pairs. + +## Declaration + +```shell + parser parser_name { + sdata-parser( + template("") + prefix("") + ); + }; +``` + +{{% include-headless "chunk/option-parser-prefix.md" %}} + +{{% include-headless "chunk/option-parser-template.md" %}} diff --git a/content/headless/chunk/option-parser-template.md b/content/headless/chunk/option-parser-template.md index f1b2832b..b2016b84 100644 --- a/content/headless/chunk/option-parser-template.md +++ b/content/headless/chunk/option-parser-template.md @@ -6,7 +6,7 @@ | | | | --------- | ---------------------------- | -| Synopsis: | template("${}") | +| Synopsis: | `template("${}")` | *Description:* The macro that contains the part of the message that the parser will process. It can also be a macro created by a previous parser of the log path. By default, the parser processes the entire message (`${MESSAGE}`).