Skip to content

Commit

Permalink
Prepare repository for Tenzir v4.10.2 (#4029)
Browse files Browse the repository at this point in the history
This commit is was created with /scripts/prepare-release.

Here is a high-level summary of the changes:

* Updated `/version.json` to v4.10.2.
* Generated a new entry in the docs version selector list.
* Removed the docs for the previous release candidate.
* Moved all changelog entries from `/changelog/next` to
`/changelog/v4.10.2`.
* Updated the python bindings version in `/python/pyproject.toml` to
v4.10.2.
  • Loading branch information
dominiklohmann committed Mar 12, 2024
2 parents 70fb7f4 + dcd5a5e commit 3249abe
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 18 deletions.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "tenzir"
version = "4.10.1"
version = "4.10.2"
description = "A security telemetry engine for detection and response"
authors = ["Tenzir <engineering@tenzir.com>"]
maintainers = ["Tenzir <engineering@tenzir.com>"]
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"annotated git tag without the leading 'v'.",
"This value gets updated automatically by `scripts/prepare-release`."
],
"tenzir-version": "4.10.1",
"tenzir-version": "4.10.2",
"tenzir-partition-version_COMMENT": [
"The partition version. This number must be bumped alongside the release",
"version for releases that contain major format changes to the on-disk",
Expand Down
42 changes: 26 additions & 16 deletions web/versioned_docs/version-Tenzir v4.10/operators/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ Executes Python code against each event of the input.
## Synopsis

```
python [--requirements=<string>] <code>
python [--requirements <string>] <code>
python [--requirements <string>] --file <path>
```

:::info Requirements
Expand All @@ -24,26 +25,11 @@ variable of the `tenzir` or `tenzir-node` process.
The `python` operator executes user-provided Python code against each event of
the input.

The provided `<code>` describes an event-for-event transformation, i.e., it is
executed once for each input event and produces exactly output event.

An implicitly defined `self` variable represents the event. Modify it to alter
the output of the operator. Fields of the event can be accessed with the dot
notation. For example, if the input event contains fields `a` and `b` then the
Python code can access and modify them using `self.a` and `self.b`. Similarly,
new fields are added by assigning to `self.fieldname` and existing fields can be
removed by deleting them from `self`. When new fields are added, it is required
that the new field has the same type for every row of the event.

By default, the Tenzir node executing the pipeline creates a virtual environment
into which the `tenzir` Python package is installed. This behavior can be turned
off in the node configuration using the `plugin.python.create-venvs` boolean
option.

The `--requirements` flag can be used to pass additional package dependencies in
the pip format. When it is used, the argument is passed on to `pip install` in a
dedicated virtual environment.

:::note Performance
The `python` operator implementation applies the provided Python code to each
input row one bw one. We use
Expand All @@ -52,6 +38,30 @@ values to native Python data types and back to the Tenzir data model after the
transformation.
:::

### `--requirements <string>`

The `--requirements` flag can be used to pass additional package dependencies in
the pip format. When it is used, the argument is passed on to `pip install` in a
dedicated virtual environment.

### `<code>`

The provided Python code describes an event-for-event transformation, i.e., it
is executed once for each input event and produces exactly output event.

An implicitly defined `self` variable represents the event. Modify it to alter
the output of the operator. Fields of the event can be accessed with the dot
notation. For example, if the input event contains fields `a` and `b` then the
Python code can access and modify them using `self.a` and `self.b`. Similarly,
new fields are added by assigning to `self.fieldname` and existing fields can be
removed by deleting them from `self`. When new fields are added, it is required
that the new field has the same type for every row of the event.

### `--file <path>`

Instead of providing the code inline, the `--file` option allows for passing
a path to a file containing the code the operator executes per event.

## Examples

Insert or modify the field `x` and set it to `"hello, world"`:
Expand Down

0 comments on commit 3249abe

Please sign in to comment.