Skip to content

Commit 3803847

Browse files
committed
Merge remote-tracking branch 'origin/topic/robin/readme-polish'
* origin/topic/robin/readme-polish: Polish README a bit.
2 parents 570e761 + b965191 commit 3803847

File tree

6 files changed

+41
-45
lines changed

6 files changed

+41
-45
lines changed

CHANGES

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,27 @@
1-
2.0.4-26 | 2022-03-23 11:19:46 +0100
1+
2.1.0 | 2022-03-29 12:45:55 +0200
22

3-
* Add `files_columns` table that extracts selected columns from
4-
on-disk files und sends them over to Zeek as a record. For
5-
example: `SELECT columns from files_columns("/etc/passwd",
6-
"$1:text,$3:count", ":")` splits `/etc/passwd` into its parts,
7-
extracts the user name and ID for each line, and then sends Zeek a
8-
record containing two fields: the name as a `string`, and the ID
9-
as a `count`. See the `README` for an explanation on the
10-
parameters that `files_columns` takes.
3+
* GH-25: Add `files_columns` table that extracts selected columns
4+
from on-disk files und sends them over to Zeek as a record. See
5+
the `README` for documentation.
116

12-
* Update SQLite to 3.38.1 to give us built-in JSON support.
13-
14-
2.0.4-22 | 2022-03-22 17:09:08 +0100
15-
16-
* GH-7: Extend the type system for table columns.
17-
18-
We can now represent addresses, booleans, counts, intervals, ports,
19-
records, sets, times, and vectors all end-to-end, so that they arrive
20-
as such at Zeek. For those types that don't have a natural SQLite
21-
representation we internally serialize them into JSON and store that
22-
as BLOBS. For boolean values, we now store real bools instead of
23-
turning them into integers, allowing us to render them more nicely
24-
even without further type information. This requires a bit of compiler
25-
voodoo because of C++ ickyness (and a GCC bug).
26-
27-
We also update our tables to use the new types where appropriate.
7+
* GH-7: Extend the type system for table columns. We can now
8+
represent addresses, booleans, counts, intervals, ports, records,
9+
sets, times, and vectors end-to-end, so that they arrive as such
10+
at Zeek. We also update our tables to use the new types where
11+
appropriate.
2812

29-
Closes #7.
13+
* GH-34: Disable communication with a Zeek instance if it's package
14+
version is too old.
3015

31-
* Add a 2nd 'differences' mode where no initial snapshot is
32-
provided. We now have (1) "snapshot-and-diffs", which sends an
16+
* Add a 2nd 'differences' mode to queries where no initial snapshot
17+
is provided. We now have (1) "snapshot-and-diffs", which sends an
3318
initial snapshot first, followed by diffs; and (2) "diffs", which
3419
sends an empty initial result and then just diffs.
3520

21+
* Move numerical version number computation from CMake to runtime.
22+
23+
* Update SQLite to 3.38.1 to give us built-in JSON support.
24+
3625
* Add Broker version to agent handshake.
3726

3827
* Support default values for table parameters.
@@ -58,8 +47,6 @@
5847

5948
* Format Zeek scripts with current zeek-format.
6049

61-
* Update to current Zeek package.
62-
6350
2.0.4 | 2022-03-04 16:55:11 +0100
6451

6552
* Add new log options. In the configuration file we now provide more

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ table parameter, which is a string containing a comma-separated list
179179
of tuples `$<N>:<type>`, where `<N>` is a column number (`$1` being
180180
the 1st column, `$2` the 2nd, etc.); and `<type>` is the type as which
181181
the value in that column will be parsed. Types can be: `blob`,
182-
`count`, int`, `real`, `text`. (As a special case, the column `$0`
183-
refers to whole line, without any processing.)
182+
`count`, `int`, `real`, `text`. As a special case, the column `$0`
183+
refers to whole line, without any processing.
184184

185185
The column separator is specified by the 3rd table parameter. It can
186186
be either left empty for splitting on white-space, or a string to
@@ -198,14 +198,18 @@ out into a Zeek `record`.
198198

199199
Here's an example: `SELECT columns from files_columns("/etc/passwd",
200200
"$1:text,$3:count", ":")` splits `/etc/passwd` into its parts, and
201-
extracts the user name and ID for each line.
201+
extracts the user name and ID for each line. (As `passwd` files may
202+
include comments lines, you could add a 4th parameter `"^ *#"` to
203+
ignore these. However, comments starting with `#` are already covered
204+
by the pattern that the 4th parameter uses by default, so it's not
205+
necessary.)
202206

203207
| Parameter | Type | Description | Default
204208
| --- | --- | --- | --- |
205209
| `pattern` | text | glob matching all files of interest | |
206210
| `columns` | text | specification of columns to extract | |
207-
| `separator` | text | separator string to split columns; empty for whitespace | `""` |
208-
| `ignore` | text | regular expression matching lines to ignore; empty to disable | `^[ \t]*([#;]|$)` |
211+
| `separator` | text | separator string to split columns; empty for whitespace | `<empty>` |
212+
| `ignore` | text | regular expression matching lines to ignore; empty to disable | `^[ \t]*([#;]\|$)` |
209213

210214
| Column | Type | Description
211215
| --- | --- | --- |

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.4-26
1+
2.1.0

auxil/autodoc-to-md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ def renderTable(name, meta):
5858
default = column["default"]
5959
if default != None:
6060
if default == "":
61-
default = '""'
61+
default = '<empty>'
6262

63-
default = "`{}`".format(default)
63+
default = "`{}`".format(default.replace("|", "\\|"))
6464
else:
6565
default = ""
6666

src/tables/files/files.h

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ class FilesColumnsCommon : public FilesBase {
9999
comma-separated list of tuples `$<N>:<type>`, where `<N>` is a
100100
column number (`$1` being the 1st column, `$2` the 2nd,
101101
etc.); and `<type>` is the type as which the value in that
102-
column will be parsed. Types can be: `blob`, `count`, int`,
103-
`real`, `text`. (As a special case, the column `$0` refers to
104-
whole line, without any processing.)
102+
column will be parsed. Types can be: `blob`, `count`, `int`,
103+
`real`, `text`. As a special case, the column `$0` refers to
104+
whole line, without any processing.
105105
106106
The column separator is specified by the 3rd table parameter.
107107
It can be either left empty for splitting on white-space, or a
@@ -119,9 +119,14 @@ class FilesColumnsCommon : public FilesBase {
119119
the selected values for each line. On the Zeek-side, this array
120120
will roll out into a Zeek `record`.
121121
122-
Here's an example: `SELECT columns from files_columns("/etc/passwd",
123-
"$1:text,$3:count", ":")` splits `/etc/passwd` into its parts,
124-
and extracts the user name and ID for each line.
122+
Here's an example: `SELECT columns from
123+
files_columns("/etc/passwd", "$1:text,$3:count", ":")` splits
124+
`/etc/passwd` into its parts, and extracts the user name and ID
125+
for each line. (As `passwd` files may include comments lines,
126+
you could add a 4th parameter `"^ *#"` to ignore these.
127+
However, comments starting with `#` are already covered by the
128+
pattern that the 4th parameter uses by default, so it's not
129+
necessary.)
125130
)",
126131
.platforms = { Platform::Darwin, Platform::Linux },
127132
.columns = {

zeek-agent

0 commit comments

Comments
 (0)