diff --git a/config/_default/config.toml b/config/_default/config.toml index 474443fc..23576114 100644 --- a/config/_default/config.toml +++ b/config/_default/config.toml @@ -172,9 +172,9 @@ description = "Documentation for AxoSyslog, the scalable security data processor [params.product] name = "AxoSyslog" abbrev = "AxoSyslog" -version = "4.17" -techversion = "4.17.0" -configversion = "4.17" +version = "4.18" +techversion = "4.18.0" +configversion = "4.18" syslog-ng = "syslog-ng" selinux = "SELinux" apparmor = "AppArmor" diff --git a/content/chapter-destinations/configuring-destinations-http-nonjava/reference-destination-http-nonjava/_index.md b/content/chapter-destinations/configuring-destinations-http-nonjava/reference-destination-http-nonjava/_index.md index 8a55ddf8..ef6cad4a 100644 --- a/content/chapter-destinations/configuring-destinations-http-nonjava/reference-destination-http-nonjava/_index.md +++ b/content/chapter-destinations/configuring-destinations-http-nonjava/reference-destination-http-nonjava/_index.md @@ -191,21 +191,21 @@ For details on how this option influences HTTP batch mode, see [http: Posting me | | | | -------- | ----------- | -| Type: | string list | +| Type: | string or template list | | Default: | | *Description:* Custom HTTP headers to include in the request, for example, `headers("HEADER1: header1", "HEADER2: header2")`. If not set, only the default headers are included, but no custom headers. The following headers are included by default: - - X-Syslog-Host: `` +- X-Syslog-Host: `` +- X-Syslog-Program: `` +- X-Syslog-Facility: `` +- X-Syslog-Level: `` - - X-Syslog-Program: `` - - - X-Syslog-Facility: `` - - - X-Syslog-Level: `` +Starting with {{< product >}} 4.18, you can use templates in the headers. Note that when using batching in the destination adn templates in `headers()`, the value of the template is calculated from the first message of the batch. Make sure to set the [`worker-partition-key()`](#worker-partition-key) option properly to group similar messages. +If you want to use literal dollar signs (`$`) in `headers()`, escape them like `$$`. {{< include-headless "chunk/option-destination-hook.md" >}} diff --git a/content/filterx/filterx-parsing/csv/reference-parsers-csv/_index.md b/content/filterx/filterx-parsing/csv/reference-parsers-csv/_index.md index 6c0b6d1a..b53075db 100644 --- a/content/filterx/filterx-parsing/csv/reference-parsers-csv/_index.md +++ b/content/filterx/filterx-parsing/csv/reference-parsers-csv/_index.md @@ -69,6 +69,26 @@ Using the `greedy=true` flag will assign the remainder of the message to the las my-parsed-values = parse_csv(${MESSAGE}, columns=["COLUMN1", "COLUMN2", "COLUMN3"], delimiters=[","], greedy=true); ``` +## quote-pairs() {#quote-pairs} + +| | | +| --------- | ------------------------------- | +| Synopsis: | `quote-pairs=["", ""]` | + +Available in {{% param "product.abbrev" %}} 4.18 and later. + +*Description:* List of quote pairs that are ignored and removed from the beginning and end of the strings. Note that the beginning and ending quote character does not have to be identical, for example, `[}` can also be a quote-pair. + +In the following example, square brackets (`[]`) and single-quotes (`'`) are ignored: + +```shell +filterx { + str = "value1,[value2],'value3'"; + ${MESSAGE} = parse_csv(str, quote_pairs=["[]", "'"]); + # The value of ${MESSAGE} will be "value1,value2,value3" +}; +``` + ## strip_whitespace {#strip-whitespace} | | | diff --git a/content/filterx/operator-reference.md b/content/filterx/operator-reference.md index ef70b26c..0feb16a7 100644 --- a/content/filterx/operator-reference.md +++ b/content/filterx/operator-reference.md @@ -29,6 +29,13 @@ Note that: - If one operand is integer and the other is double, the result will be double. - The `+` operator can add strings and other types as well, for details, see the [Plus operator]({{< relref "#plus-operator" >}}). - To increase the value of a variable, see the [Plus equal operator]({{< relref "#plus-equal-operator" >}}). +- In version 4.18 and later, you can use the `+` and `-` operators as unary operators with a single operand to indicate a positive or a negative value. For example: + + ```shell + a = 42; + b = -a; + # b is -42 + ``` ### Plus operator @@ -224,6 +231,18 @@ filterx { }; ``` +Staring with {{< product >}} version 4.18, you can use the `-` operator with a variable to to refer to characters from the end of the string, for example: + +```shell +filterx { + str = "example"; + idx = 3; + str[..-idx] == "exam"; + str[-idx..] == "ple"; + str[idx..-idx] == "m"; +}; +``` + ## Ternary conditional operator The [ternary conditional operator](https://en.wikipedia.org/wiki/Ternary_conditional_operator) evaluates an expression and returns the first argument if the expression is true, and the second argument if it's false. diff --git a/content/whats-new/_index.md b/content/whats-new/_index.md index 41bc015a..62e487d9 100644 --- a/content/whats-new/_index.md +++ b/content/whats-new/_index.md @@ -4,7 +4,13 @@ weight: 10 --- -This page is a changelog that collects the major changes and additions to this documentation. (If you want to know the details about why we have separate documentation for AxoSyslog and how it relates to the `syslog-ng` documentation, read our [syslog-ng documentation and similarities with AxoSyslog Core](https://axoflow.com/blog/axosyslog-core-documentation-syslog-ng) blog post.) +{{< include-headless "banner-new-to-axosyslog.md" >}} + +## Version 4.18 (2025-09-30) + +- You can now use macros and templates in the [`headers()` option]({{< relref "/chapter-destinations/configuring-destinations-http-nonjava/reference-destination-http-nonjava/_index.md#headers" >}}) of the `http()` destination to set the headers dynamically. +- The `parse_csv` FilterX parser now supports the [`quote-pairs`]({{< relref "/filterx/filterx-parsing/csv/reference-parsers-csv/_index.md#quote-pairs" >}}) option. +- [`+` and `-` unary operators]({{< relref "/filterx/operator-reference.md#slicing" >}}) for FilterX. ## Version 4.17 (2025-09-04)