Skip to content

Commit

Permalink
news: add several entries
Browse files Browse the repository at this point in the history
FilterX entries since 4.8.0.
Any other missing entries since 4.8.1.

Signed-off-by: Attila Szakacs <[email protected]>
  • Loading branch information
alltilla committed Nov 8, 2024
1 parent 08498a6 commit 1041c73
Show file tree
Hide file tree
Showing 31 changed files with 228 additions and 0 deletions.
2 changes: 2 additions & 0 deletions news/bugfix-296.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
`stats`: Fixed `free_window` counters.

14 changes: 14 additions & 0 deletions news/feature-326.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
`syslog-ng-ctl`: Added `attach` subcommand.

With `attach`, it is possible to attach to the
standard IO of the `syslog-ng` proccess.

Example usage:
```
# takes the stdio fds for 10 seconds and displays syslog-ng output in that time period
$ syslog-ng-ctl attach stdio --seconds 10
```
```
# steal trace level log messages for 10 seconds
$ syslog-ng-ctl attach logs --seconds 10 --level trace
```
4 changes: 4 additions & 0 deletions news/feature-351.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
socked based sources: Added new flag, called `exit-on-eof`

Setting this flag to a source makes AxoSyslog stop,
when EOF is received.
4 changes: 4 additions & 0 deletions news/feature-355.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
socked based sources: Added a new option called `idle-timeout()`.

Setting this option makes AxoSyslog close the client connection
if no data is received for the set amount of seconds.
19 changes: 19 additions & 0 deletions news/filterx-203.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
`regexp_subst()`: Added various pcre flags.

* `jit`:
* enables or disables JIT compliling
* default: `true`
* `global`:
* sets whether all found matches should be replaced
* default: `false`
* `utf8`:
* enables or disables UTF-8 validation
* default: `false`
* `ignorecase`
* sets case sensitivity
* default: `false` (case-sensitive)
* `newline`
* configures the behavior of end of line finding
* `false` returns end of line when CR, LF and CRLF characters are found
* `true` makes the matcher process CR, LF, CRLF characters
* default: `false`
2 changes: 2 additions & 0 deletions news/filterx-215.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
`unset()`: Now accepts any number of variables to unset.

2 changes: 2 additions & 0 deletions news/filterx-217.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Added `+` operator.

2 changes: 2 additions & 0 deletions news/filterx-218.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
`format_csv()`: Fixed delimiter formatting.

2 changes: 2 additions & 0 deletions news/filterx-219-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
`parse_csv()`: Changed strip whitespace default to `false`.

2 changes: 2 additions & 0 deletions news/filterx-219-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
`parse_csv()`: Renamed `strip_whitespaces` argument to `strip_whitespace`.

6 changes: 6 additions & 0 deletions news/filterx-220.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
`update_metric()`: Added a new function similar to `metrics-probe` parser.

Example usage:
```
update_metric("filterx_metric", labels={"msg": $MSG, "foo": "foovalue"}, level=1, increment=$INCREMENT);
```
10 changes: 10 additions & 0 deletions news/filterx-221.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
`flatten()`: Added new function to flatten dicts and lists.

The function modifies the object in-place.
The separator can be set with the `separator` argument,
which is `.` by default.

Example usage:
```
flatten(my_dict_or_list, separator="->");
```
2 changes: 2 additions & 0 deletions news/filterx-230.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
`json`: Fixed a crash that occured when doubles were stored and accessed.

2 changes: 2 additions & 0 deletions news/filterx-238.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Added `!~` operator as the negated `=~` operator.

15 changes: 15 additions & 0 deletions news/filterx-242.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Added new RFC5424 SDATA related functions.

All of the functions require traditional syslog parsing beforehand.

* `has_sdata()`
* Returns whether the current log has SDATA information.
* Example: `sdata_avail = has_sdata(;)`
* `is_sdata_from_enterprise()`
* Checks if there is SDATA that corresponds to the given enterprise ID.
* Example: `sdata_from_6876 = is_sdata_from_enterprise("6876");`
* `get_sdata()`
* Returns a 2 level dict of the available SDATAs.
* Example: `sdata = get_sdata();`
* Returns: `{"Originator@6876": {"sub": "Vimsvc.ha-eventmgr", "opID": "esxui-13c6-6b16"}}`

2 changes: 2 additions & 0 deletions news/filterx-249.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
`parse_csv()`: Fixed a race condition.

52 changes: 52 additions & 0 deletions news/filterx-251.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
`parse_xml()`: Added new function to parse XMLs.

Example usage:
```
my_structured_data = parse_xml(raw_xml);
```

Converting XML to a dict is not standardized.

Our intention is to create the most compact dict as possible,
which means certain nodes will have different types and
structures based on a number of different qualities of the
input XML element.

The following points will demonstrate the choices we made in our parser.
In the examples we will use the JSON dict implementation.

1. Empty XML elements become empty strings.
```
XML: <foo></foo>
JSON: {"foo": ""}
```

2. Attributions are stored in `@attr` key-value pairs,
similarly to some other converters (e.g.: python xmltodict).
```
XML: <foo bar="123" baz="bad"/>
JSON: {"foo": {"@bar": "123", "@baz": "bad"}}
```

3. If an XML element has both attributes and a value,
we need to store them in a dict, and the value needs a key.
We store the text value under the #text key.
```
XML: <foo bar="123">baz</foo>
JSON: {"foo": {"@bar": "123", "#text": "baz"}}
```

4. An XML element can have both a value and inner elements.
We use the `#text` key here, too.
```
XML: <foo>bar<baz>123</baz></foo>
JSON: {"foo": {"#text": "bar", "baz": "123"}}
```

5. An XML element can have multiple values separated by inner elements.
In that case we concatenate the values.
```
XML: <foo>bar<a></a>baz</foo>
JSON: {"foo": {"#text": "barbaz", "a": ""}}
```

7 changes: 7 additions & 0 deletions news/filterx-255.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Use `json` and `json_array` as default types for dict and list literals.

This is now a valid config and creates `json` and `json_array` objects:
```
my_json_object = {"foo": "bar"};
my_json_array = ["foo", "bar"];
```
2 changes: 2 additions & 0 deletions news/filterx-257.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fixed race conditions in several functions.

2 changes: 2 additions & 0 deletions news/filterx-258.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
`json`: Fixed race condition in marshalling.

5 changes: 5 additions & 0 deletions news/filterx-269.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Added new filterx control flow controls.

* `drop`: Drops the currently processed message and returns success.
* `done`: Stops the processing and returns success.

2 changes: 2 additions & 0 deletions news/filterx-273.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
`json_array`: Fixed failing to return `null` values.

21 changes: 21 additions & 0 deletions news/filterx-275.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
`unset_empties()`: Added advanced options.

`unset_empties` removes elements from the given dictionary or list that match
the empties set. If the `recursive` argument is provided, the function will
process nested dictionaries as well. The `replacement` argument allows
replacing target elements with a specified object, and the targets
argument customizes which elements are removed or replaced, overriding
the default empties set.

* Optional named arguments:
* recursive: Enables recursive processing of nested dictionaries. default: `true`
* ignorecase: Enables case-insensitive matching. default: `true`
* replacement: Specifies an object to replace target elements instead of removing them.
default: nothing (remove)
* targets: A list of elements to identify for removal or replacement, clearing the default empty set.
default: `["", null, [], {}]`

Example usage:
```
unset_empties(js1, targets=["foo", "bar", null, "", [], {}], ignorecase=false, replacement="N/A", recursive=false);
```
8 changes: 8 additions & 0 deletions news/filterx-282.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
`parse_windows_eventlog_xml()`: Added a new function to parse Windows EventLog XMLs.

This parser is really similar to `parse_xml()` with
a couple of small differences:

1. There is a quick schema validation.
2. The `Event`->`EventData` field automatically handles named `Data` elements.

2 changes: 2 additions & 0 deletions news/filterx-283.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
`datetime`: 0 valued `datetime` objects are now falsy.

2 changes: 2 additions & 0 deletions news/filterx-284.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
`datetime`: `datetime` objects can now be cased to `integer` and `double`.

2 changes: 2 additions & 0 deletions news/filterx-287-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Declared variables now can be set with dict and list literals.

2 changes: 2 additions & 0 deletions news/filterx-287-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
`parse_csv()`: Fixed an invalid read.

18 changes: 18 additions & 0 deletions news/filterx-297.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
`startswith()`, `endswith()`, `includes()`: Added string matching functions.

* First argument is the string that is being matched.
* Second argument is either a single substring or a list of substrings.
* Optionally the `ignorecase` argument can be set to configure case sensitivity
* default: `false`

Example usage:
```
startswith(string, prefix, ignorecase=false);
startswith(string, [prefix_1, prefix_2], ignorecase=true);
endswith(string, suffix, ignorecase=false);
endswith(string, [suffix_1, suffix_2], ignorecase=true);
includes(string, substring, ignorecase=false);
includes(string, [substring_1, substring_2], ignorecase=true);
```
11 changes: 11 additions & 0 deletions news/filterx-324.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
`parse_cef()`, `parse_leef()`: Added CEF and LEEF parsers.

* The first argument is the raw message.
* Optionally `pair_separator` and `value_separator` arguments
can be set to override the respective extension parsing behavior.

Example usage:
```
my_structured_leef = parse_leef(leef_message);
my_structured_cef = parse_cef(cef_message);
```
2 changes: 2 additions & 0 deletions news/filterx-333.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fixed LogMessage -> FilterX variable synchronization.

0 comments on commit 1041c73

Please sign in to comment.