@tenzir/codemirror-lang-tql 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/output.js ADDED
@@ -0,0 +1,336 @@
1
+ export const data = [
2
+ {
3
+ label: "discard",
4
+ type: "keyword",
5
+ detail: "Discards all incoming events.",
6
+ processedHTML:
7
+ '<div class="remark-container note"><p>This operator is mainly used to test or benchmark pipelines.</p></div>\n<h2>Synopsis</h2>\n<pre><code>discard\n</code></pre>\n<h2>Description</h2>\n<p>The <code>discard</code> operator has a similar effect as <code>to file /dev/null write json</code>,\nbut it immediately discards all events without rendering them as JSON first.</p>\n<h2>Examples</h2>\n<p>We can benchmark the following pipeline to see how long it takes to export\neverything.</p>\n<pre><code>export | discard\n</code></pre>',
8
+ docLink: "https://docs.tenzir.com/operators/sinks/discard",
9
+ },
10
+ {
11
+ label: "import",
12
+ type: "keyword",
13
+ detail: "Imports events into a Tenzir node. The dual to export.",
14
+ processedHTML:
15
+ '<h2>Synopsis</h2>\n<pre><code>import\n</code></pre>\n<h2>Description</h2>\n<p>The <code>import</code> operator persists events in a Tenzir node.</p>\n<div class="remark-container note"><div class="remark-container-title note">Flush to disk</div><p>Pipelines ending in the <code>import</code> operator do not wait until all events in the\npipelines are written to disk.</p><p>We plan to change this behavior in the near future. Until then, we recommend\nrunning <code>tenzir-ctl flush</code> after importing events to make sure they\'re available\nfor downstream consumption.</p></div>\n<h2>Examples</h2>\n<p>Import Zeek conn logs into a Tenzir node.</p>\n<pre><code>from file conn.log read zeek-tsv | import\n</code></pre>',
16
+ docLink: "https://docs.tenzir.com/operators/sinks/import",
17
+ },
18
+ {
19
+ label: "save",
20
+ type: "keyword",
21
+ detail: "The save operator acquires raw bytes from a connector.",
22
+ processedHTML:
23
+ '<div class="remark-container warning"><div class="remark-container-title warning">Expert Operator</div><p>The <code>save</code> operator is a lower-level building block of the <a href="to.md"><code>to</code></a>\noperator. Only use this if you need to operate on raw bytes.</p></div>\n<h2>Synopsis</h2>\n<pre><code>save &#x3C;connector>\n</code></pre>\n<h2>Description</h2>\n<p>The <code>save</code> operator operates on raw bytes.</p>\n<p>Notably, it cannot be used after an operator that emits events, but rather only\nwith operators that emit bytes, e.g., <a href="../transformations/write.md"><code>write</code></a> or\n<a href="../sources/load.md"><code>load</code></a>.</p>\n<h3><code>&#x3C;connector></code></h3>\n<p>The <a href="../../connectors.md">connector</a> used to save bytes.</p>\n<p>Some connectors have connector-specific options. Please refer to the\ndocumentation of the individual connectors for more information.</p>\n<h2>Examples</h2>\n<p>Write bytes to stdout:</p>\n<pre><code>save stdin\n</code></pre>\n<p>Write bytes to the file <code>path/to/eve.json</code>:</p>\n<pre><code>save file path/to/eve.json\n</code></pre>',
24
+ docLink: "https://docs.tenzir.com/operators/sinks/save",
25
+ },
26
+ {
27
+ label: "serve",
28
+ type: "keyword",
29
+ detail: "Make events available under the \\[/serve REST API",
30
+ processedHTML:
31
+ '<p>endpoint](/api#/paths/~1serve/post).</p>\n<h2>Synopsis</h2>\n<pre><code>serve [--buffer-size &#x3C;buffer-size>] &#x3C;serve-id>\n</code></pre>\n<h2>Description</h2>\n<p>The <code>serve</code> operator bridges between pipelines and the corresponding <code>/serve</code>\nREST API endpoint.</p>\n<p>Pipelines ending with the <code>serve</code> operator exit when all events have been\ndelivered over the corresponding endpoint.</p>\n<h3><code>--buffer-size &#x3C;buffer-size></code></h3>\n<p>The buffer size specifies the maximum number of events to keep in the <code>serve</code>\noperator to make them instantly available in the corresponding endpoint before\nthrottling the pipeline execution.</p>\n<p>Defaults to <code>64Ki</code>.</p>\n<h3><code>&#x3C;serve-id></code></h3>\n<p>The serve id is an identifier that uniquely identifies the operator. The <code>serve</code>\noperator errors when receiving a duplicate serve id.</p>\n<h2>Examples</h2>\n<p>Read a Zeek conn.log, 100 events at a time:</p>\n<pre><code class="language-bash">tenzir \'from file path/to/conn.log read zeek-tsv | serve zeek-conn-logs\'\n</code></pre>\n<pre><code class="language-bash">curl \\\n -X POST \\\n -H "Content-Type: application/json" \\\n -d \'{"serve_id": "zeek-conn-logs", "continuation_token": null, "timeout": "1s", "max_events": 100}\' \\\n http://localhost:5160/api/v0/serve\n</code></pre>\n<p>This will return up to 100 events, or less if the specified timeout of 1 second\nexpired.</p>\n<p>Subsequent results for further events must specify a continuation token. The\ntoken is included in the response under <code>next_continuation_token</code> if there are\nfurther events to be retrieved from the endpoint.</p>',
32
+ docLink: "https://docs.tenzir.com/operators/sinks/serve",
33
+ },
34
+ {
35
+ label: "to",
36
+ type: "keyword",
37
+ detail:
38
+ "Consumes events by combining a \\[connector]\\[connectors] and a \\[format]\\[formats].",
39
+ processedHTML:
40
+ '<h2>Synopsis</h2>\n<pre><code>to &#x3C;connector> [write &#x3C;format>]\n</code></pre>\n<h2>Description</h2>\n<p>The <code>to</code> operator consumes events at the end of a pipeline by bringing together\na <a href="../../connectors.md">connector</a> and a <a href="../../formats.md">format</a>.</p>\n<p>All connectors have a default format, which depends on the connector. This enables\na shorter syntax, e.g., <code>to stdout</code> uses the <code>json</code> format, while <code>to file foo.csv</code>\nuses the <code>csv</code> format.</p>\n<p>The <code>to</code> operator is a pipeline under the hood. For most cases, it is equal to\n<code>write &#x3C;format> | save &#x3C;connector></code>. However, for some combinations of\nconnectors and formats the underlying pipeline is a bit more complex. We\nrecommend always using <code>to ... write ...</code> over the\n<a href="../transformations/write.md"><code>write</code></a> and <a href="save.md"><code>save</code></a> operators.</p>\n<h3><code>&#x3C;connector></code></h3>\n<p>The <a href="../../connectors.md">connector</a> used to save bytes.</p>\n<p>Some connectors have connector-specific options. Please refer to the\ndocumentation of the individual connectors for more information.</p>\n<h3><code>&#x3C;format></code></h3>\n<p>The <a href="../../formats.md">format</a> used to print events to bytes.</p>\n<p>Some formats have format-specific options. Please refer to the documentation of\nthe individual formats for more information.</p>\n<h2>Examples</h2>\n<p>Write events to stdout formatted as CSV.</p>\n<pre><code>to stdout write csv\n</code></pre>\n<p>Write events to the file <code>path/to/eve.json</code> formatted as JSON.</p>\n<pre><code>to file path/to/eve.json write json\n</code></pre>',
41
+ docLink: "https://docs.tenzir.com/operators/sinks/to",
42
+ },
43
+ {
44
+ label: "export",
45
+ type: "keyword",
46
+ detail: "Retrieves events from a Tenzir node. The dual to import.",
47
+ processedHTML:
48
+ '<h2>Synopsis</h2>\n<pre><code>export\n</code></pre>\n<h2>Description</h2>\n<p>The <code>export</code> operator retrieves events from a Tenzir node.</p>\n<div class="remark-container note"><div class="remark-container-title note">Flush to disk</div><p>Pipelines starting with the <code>export</code> operator do not access events that are not\nwritten to disk.</p><p>We recommend running <code>tenzir-ctl flush</code> before exporting events to make sure\nthey\'re available for downstream consumption.</p></div>\n<h2>Examples</h2>\n<p>Expose all persisted events as JSON data.</p>\n<pre><code>export | to stdout\n</code></pre>\n<p><a href="../transformations/where.md">Apply a filter</a> to all persisted events, then\n<a href="../transformations/head.md">only expose the first ten results</a>.</p>\n<pre><code>export | where 1.2.3.4 | head 10 | to stdout\n</code></pre>',
49
+ docLink: "https://docs.tenzir.com/operators/sources/export",
50
+ },
51
+ {
52
+ label: "from",
53
+ type: "keyword",
54
+ detail:
55
+ "Produces events by combining a \\[connector]\\[connectors] and a \\[format]\\[formats].",
56
+ processedHTML:
57
+ '<h2>Synopsis</h2>\n<pre><code>from &#x3C;connector> [read &#x3C;format>]\n</code></pre>\n<h2>Description</h2>\n<p>The <code>from</code> operator produces events at the beginning of a pipeline by bringing\ntogether a <a href="../../connectors.md">connector</a> and a <a href="../../formats.md">format</a>.</p>\n<p>All connectors have a default format. This enables a shorter syntax, e.g.,\n<code>from stdin</code> uses the <code>json</code> format, while <code>from file foo.csv</code> uses the <code>csv</code>\nformat.</p>\n<p>The <code>from</code> operator is a pipeline under the hood. For most cases, it is equal to\n<code>load &#x3C;connector> | read &#x3C;format></code>. However, for some combinations of\nconnectors and formats the underlying pipeline is a lot more complex. We\nrecommend always using <code>from ... read ...</code> over the <a href="load.md"><code>load</code></a> and\n<a href="../transformations/read.md"><code>read</code></a> operators.</p>\n<h3><code>&#x3C;connector></code></h3>\n<p>The <a href="../../connectors.md">connector</a> used to load bytes.</p>\n<p>Some connectors have connector-specific options. Please refer to the\ndocumentation of the individual connectors for more information.</p>\n<h3><code>&#x3C;format></code></h3>\n<p>The <a href="../../formats.md">format</a> used to parse events from the loaded bytes.</p>\n<p>Some formats have format-specific options. Please refer to the documentation of\nthe individual formats for more information.</p>\n<h2>Examples</h2>\n<p>Read bytes from stdin and parse them as JSON.</p>\n<pre><code>from stdin read json\nfrom file stdin read json\nfrom file - read json\nfrom - read json\n</code></pre>\n<p>Read bytes from the file <code>path/to/eve.json</code> and parse them as Suricata.\nNote that the <code>file</code> connector automatically assigns the Suricata parser for\n<code>eve.json</code> files when no other parser is specified.</p>\n<pre><code>from file path/to/eve.json\nfrom file path/to/eve.json read suricata\n</code></pre>',
58
+ docLink: "https://docs.tenzir.com/operators/sources/from",
59
+ },
60
+ {
61
+ label: "load",
62
+ type: "keyword",
63
+ detail: "The load operator acquires raw bytes from a connector.",
64
+ processedHTML:
65
+ '<div class="remark-container warning"><div class="remark-container-title warning">Expert Operator</div><p>The <code>load</code> operator is a lower-level building block of the <a href="from.md"><code>from</code></a>\noperator. Only use this if you need to operate on raw bytes.</p></div>\n<h2>Synopsis</h2>\n<pre><code>load &#x3C;connector>\n</code></pre>\n<h2>Description</h2>\n<p>The <code>load</code> operator emits raw bytes.</p>\n<p>Notably, it cannot be used together with operators that expect events as input,\nbut rather only with operators that expect bytes, e.g.,\n<a href="../transformations/read.md"><code>read</code></a> or <a href="../sinks/save.md"><code>save</code></a>.</p>\n<h3><code>&#x3C;connector></code></h3>\n<p>The <a href="../../connectors.md">connector</a> used to load bytes.</p>\n<p>Some connectors have connector-specific options. Please refer to the\ndocumentation of the individual connectors for more information.</p>\n<h2>Examples</h2>\n<p>Read bytes from stdin:</p>\n<pre><code>load stdin\n</code></pre>\n<p>Read bytes from the file <code>path/to/eve.json</code>:</p>\n<pre><code>from file path/to/eve.json\n</code></pre>',
66
+ docLink: "https://docs.tenzir.com/operators/sources/load",
67
+ },
68
+ {
69
+ label: "shell",
70
+ type: "keyword",
71
+ detail: "Executes a system command and hooks its stdout into the pipeline.",
72
+ processedHTML:
73
+ '<h2>Synopsis</h2>\n<pre><code>shell &#x3C;command>\n</code></pre>\n<h2>Description</h2>\n<p>Refer to <a href="../transformations/shell.md"><code>shell</code> as transformation</a> for usage\ninstructions.</p>\n<p>The difference to the transformation is that the source operator receives the\nstandard input from the terminal where <code>tenzir</code> is executed from. If the\npipeline was not spawned by a terminal, no standard input is provided.</p>\n<h2>Examples</h2>\n<p>Show a live log from the <code>tenzir-node</code> service:</p>\n<pre><code>shell "journalctl -u tenzir-node -f | read json"\n</code></pre>',
74
+ docLink: "https://docs.tenzir.com/operators/sources/shell",
75
+ },
76
+ {
77
+ label: "show",
78
+ type: "keyword",
79
+ detail: "Returns meta information about Tenzir and nodes.",
80
+ processedHTML:
81
+ '<div class="remark-container caution"><div class="remark-container-title caution">Experimental</div><p>This operator is experimental and subject to change without notice, even in\nminor or patch releases.</p></div>\n<h2>Synopsis</h2>\n<pre><code>show &#x3C;aspect> [options]\n</code></pre>\n<h2>Description</h2>\n<p>The <code>show</code> operator offers introspection capabilities to look at various\n<em>aspects</em> of Tenzir.</p>\n<h3><code>&#x3C;aspect></code></h3>\n<p>Describes the part of Tenzir to look at.</p>\n<p>Available aspects:</p>\n<ul>\n<li><code>build</code>: shows compile-time build information.</li>\n<li><code>config</code>: shows all current configuration options.</li>\n<li><code>connectors</code>: shows all available <a href="../../connectors.md">connectors</a>.</li>\n<li><code>dependencies</code>: shows information about build-time dependencies.</li>\n<li><code>fields</code>: shows all fields of existing tables at a remote node.</li>\n<li><code>formats</code>: shows all available <a href="../../formats.md">formats</a>.</li>\n<li><code>operators</code>: shows all available <a href="../../operators.md">operators</a>.</li>\n<li><code>partitions</code>: shows all table partitions of a remote node.</li>\n<li><code>pipelines</code>: shows all managed pipelines of a remote node.</li>\n<li><code>plugins</code>: shows all loaded plugins.</li>\n<li><code>types</code>: shows all known types at a remote node.</li>\n<li><code>version</code>: shows the Tenzir version.</li>\n</ul>\n<h2>Examples</h2>\n<p>Show all available connectors and formats:</p>\n<pre><code>show connectors\nshow formats\n</code></pre>\n<p>Show all transformations:</p>\n<pre><code>show operators | where transformation == true\n</code></pre>\n<p>Show all fields and partitions at a node:</p>\n<pre><code>show fields\nshow partitions\n</code></pre>\n<p>Show the version of a remote node:</p>\n<pre><code>remote show version\n</code></pre>',
82
+ docLink: "https://docs.tenzir.com/operators/sources/show",
83
+ },
84
+ {
85
+ label: "batch",
86
+ type: "keyword",
87
+ detail: "The batch operator controls the batch size of events.",
88
+ processedHTML:
89
+ '<div class="remark-container warning"><div class="remark-container-title warning">Expert Operator</div><p>The <code>batch</code> operator is a lower-level building block that lets users explicitly\ncontrol batching, which otherwise is controlled automatically by Tenzir\'s\nunderlying pipeline execution engine. Use with caution!</p></div>\n<h2>Synopsis</h2>\n<pre><code>batch [&#x3C;limit>]\n</code></pre>\n<h2>Description</h2>\n<p>The <code>batch</code> operator takes its input and rewrites it into batches of up to the\ndesired size.</p>\n<h3><code>&#x3C;limit></code></h3>\n<p>An unsigned integer denoting how many events to put into one batch at most.</p>\n<p>Defaults to 65536.</p>\n<h2>Examples</h2>\n<p>Write exactly one NDJSON object at a time to a Kafka topic.</p>\n<pre><code>batch 1 | to kafka -t topic write json -c\n</code></pre>',
90
+ docLink: "https://docs.tenzir.com/operators/transformations/batch",
91
+ },
92
+ {
93
+ label: "compress",
94
+ type: "keyword",
95
+ detail: "Compresses a stream of bytes.",
96
+ processedHTML:
97
+ '<h2>Synopsis</h2>\n<pre><code>compress [--level=&#x3C;level>] &#x3C;codec>\n</code></pre>\n<h2>Description</h2>\n<p>The <code>compress</code> operator compresses bytes in a pipeline incrementally with a\nknown codec.</p>\n<div class="remark-container note"><div class="remark-container-title note">Streaming Compression</div><p>The operator uses <a href="https://arrow.apache.org/docs/cpp/api/utilities.html#compression">Apache Arrow\'s compression\nutilities</a> under the hood, and transparently supports\nall options that Apache Arrow supports for streaming compression.</p><p>Besides the supported <code>brotli</code>, <code>bz2</code>, <code>gzip</code>, <code>lz4</code>, and <code>zstd</code>, Apache Arrow\nalso ships with codecs for <code>lzo</code>, <code>lz4_raw</code>, <code>lz4_hadoop</code> and <code>snappy</code>, which\nonly support oneshot compression. Support for them is not currently implemented.</p></div>\n<h3><code>--level=&#x3C;level></code></h3>\n<p>The compression level to use. The supported values depend on the codec used. If\nomitted, the default level for the codec is used.</p>\n<h3><code>&#x3C;codec></code></h3>\n<p>An identifier of the codec to use. Currently supported are <code>brotli</code>, <code>bz2</code>,\n<code>gzip</code>, <code>lz4</code>, and <code>zstd</code>.</p>\n<h2>Examples</h2>\n<p>Export all events in a Gzip-compressed NDJSON file:</p>\n<pre><code>export\n| write json --compact-output\n| compress gzip\n| save file /tmp/backup.json.gz\n</code></pre>\n<p>Recompress a Zstd-compressed file at a higher compression level:</p>\n<pre><code>load file in.zst\n| decompress zstd\n| compress --level 18 zstd\n| save file out.zst\n</code></pre>',
98
+ docLink: "https://docs.tenzir.com/operators/transformations/compress",
99
+ },
100
+ {
101
+ label: "decapsulate",
102
+ type: "keyword",
103
+ detail: "Decapsulates packet data at link, network, and transport layer.",
104
+ processedHTML:
105
+ '<div class="remark-container warning"><div class="remark-container-title warning">Deprecated</div><p>This operator will soon be removed in favor of first-class support for functions\nthat can be used in a variety of different operators and contexts.</p></div>\n<h2>Synopsis</h2>\n<pre><code>decapsulate\n</code></pre>\n<h2>Description</h2>\n<p>The <code>decapsulate</code> operator proceses events of type <code>pcap.packet</code> and\ndecapsulates the packet payload by extracting fields at the link, network, and\ntransport layer. The aim is not completeness, but rather exposing commonly used\nfield for analytics.</p>\n<p>The operator only processes events of type <code>pcap.packet</code> and emits events of\ntype <code>tenzir.packet</code>.</p>\n<h3>VLAN Tags</h3>\n<p>While decapsulating packets, <code>decapsulate</code> extracts\n<a href="https://en.wikipedia.org/wiki/IEEE_802.1Q">802.1Q</a> VLAN tags into the nested\n<code>vlan</code> record, consisting of an <code>outer</code> and <code>inner</code> field for the respective\ntags. The value of the VLAN tag corresponds to the 12-bit VLAN identifier (VID).\nSpecial values include <code>0</code> (frame does not carry a VLAN ID) and <code>0xFFF</code>\n(reserved value; sometimes wildcard match).</p>\n<h2>Examples</h2>\n<p>Decapsulate packets from a PCAP file:</p>\n<pre><code>from file /tmp/trace.pcap read pcap\n| decapsulate\n</code></pre>\n<p>Extract packets as JSON that have the address 6.6.6.6 as source or destination,\nand destination port 5158:</p>\n<pre><code>read pcap\n| decapsulate\n| where 6.6.6.6 &#x26;&#x26; dport == 5158\n| write json\n</code></pre>\n<p>Query VLAN IDs using <code>vlan.outer</code> and <code>vlan.inner</code>:</p>\n<pre><code>read pcap\n| decapsulate\n| where vlan.outer > 0 || vlan.inner in [1, 2, 3]\n</code></pre>\n<p>Filter packets by <a href="https://github.com/corelight/community-id-spec">Community\nID</a>:</p>\n<pre><code>read pcap\n| decapsulate\n| where community_id == "1:wCb3OG7yAFWelaUydu0D+125CLM="\n</code></pre>',
106
+ docLink: "https://docs.tenzir.com/operators/transformations/decapsulate",
107
+ },
108
+ {
109
+ label: "decompress",
110
+ type: "keyword",
111
+ detail: "Decompresses a stream of bytes.",
112
+ processedHTML:
113
+ '<h2>Synopsis</h2>\n<pre><code>decompress &#x3C;codec>\n</code></pre>\n<h2>Description</h2>\n<p>The <code>decompress</code> operator decompresses bytes in a pipeline incrementally with a\nknown codec. The operator supports decompressing multiple concatenated streams\nof the same codec transparently.</p>\n<div class="remark-container note"><div class="remark-container-title note">Streaming Decompression</div><p>The operator uses <a href="https://arrow.apache.org/docs/cpp/api/utilities.html#compression">Apache Arrow\'s compression\nutilities</a> under the hood, and transparently supports\nall options that Apache Arrow supports for streaming decompression.</p><p>Besides the supported <code>brotli</code>, <code>bz2</code>, <code>gzip</code>, <code>lz4</code>, and <code>zstd</code>, Apache Arrow\nalso ships with codecs for <code>lzo</code>, <code>lz4_raw</code>, <code>lz4_hadoop</code> and <code>snappy</code>, which\nonly support oneshot decompression. Support for them is not currently implemented.</p></div>\n<h3><code>&#x3C;codec></code></h3>\n<p>An identifier of the codec to use. Currently supported are <code>brotli</code>, <code>bz2</code>,\n<code>gzip</code>, <code>lz4</code>, and <code>zstd</code>.</p>\n<h2>Examples</h2>\n<p>Import Suricata events from a Zstd-compressed file:</p>\n<pre><code>load file eve.json.zst\n| decompress zstd\n| read suricata\n| import\n</code></pre>\n<p>Convert a Zstd-compressed file into an LZ4-compressed file:</p>\n<pre><code>load file in.zst\n| decompress zstd\n| compress lz4\n| save file out.lz4\n</code></pre>',
114
+ docLink: "https://docs.tenzir.com/operators/transformations/decompress",
115
+ },
116
+ {
117
+ label: "drop",
118
+ type: "keyword",
119
+ detail: "Drops fields from the input.",
120
+ processedHTML:
121
+ '<h2>Synopsis</h2>\n<pre><code>drop &#x3C;extractor>...\n</code></pre>\n<h2>Description</h2>\n<p>The <code>drop</code> operator removes all fields matching the provided extractors and\nkeeps all other fields. It is the dual to <a href="select.md"><code>select</code></a>.</p>\n<p>In relational algebra, <code>drop</code> performs a <em>projection</em> of the complement of the\nprovided arguments.</p>\n<h3><code>&#x3C;extractor>...</code></h3>\n<p>A comma-separated list of extractors that identify the fields to remove.</p>\n<h2>Examples</h2>\n<p>Remove the fields <code>foo</code> and <code>bar</code>:</p>\n<pre><code>drop foo, bar\n</code></pre>\n<p>Remove all fields of type <code>ip</code>:</p>\n<pre><code>drop :ip\n</code></pre>',
122
+ docLink: "https://docs.tenzir.com/operators/transformations/drop",
123
+ },
124
+ {
125
+ label: "enumerate",
126
+ type: "keyword",
127
+ detail: "Prepend a column with row numbers.",
128
+ processedHTML:
129
+ '<h2>Synopsis</h2>\n<pre><code>enumerate [&#x3C;field>]\n</code></pre>\n<h2>Description</h2>\n<p>The <code>enumerate</code> operator prepends a new column with row numbers to the beginning\nof the input record.</p>\n<div class="remark-container note"><div class="remark-container-title note">Per-schema Counting</div><p>The operator counts row numbers per schema. We plan to change this behavior with\na in the future once we have a modifer that toggles "per-schema-ness"\nexplicitly.</p></div>\n<h3><code>&#x3C;field></code></h3>\n<p>Sets the name of the output field.</p>\n<p>Defaults to <code>#</code> to avoid conflicts with existing field names.</p>\n<h2>Examples</h2>\n<p>Enumerate the input by prepending row numbers:</p>\n<pre><code>from file eve.json read suricata | select event_type | enumerate | write json\n</code></pre>\n<pre><code class="language-json">{"#": 0, "event_type": "alert"}\n{"#": 0, "event_type": "flow"}\n{"#": 1, "event_type": "flow"}\n{"#": 0, "event_type": "http"}\n{"#": 1, "event_type": "alert"}\n{"#": 1, "event_type": "http"}\n{"#": 2, "event_type": "flow"}\n{"#": 0, "event_type": "fileinfo"}\n{"#": 3, "event_type": "flow"}\n{"#": 4, "event_type": "flow"}\n</code></pre>\n<p>Use <code>index</code> as field name instead of the default:</p>\n<pre><code>enumerate index\n</code></pre>',
130
+ docLink: "https://docs.tenzir.com/operators/transformations/enumerate",
131
+ },
132
+ {
133
+ label: "extend",
134
+ type: "keyword",
135
+ detail: "Appends fields to events.",
136
+ processedHTML:
137
+ '<h2>Synopsis</h2>\n<pre><code>extend &#x3C;field=operand>...\n</code></pre>\n<h2>Description</h2>\n<p>The <code>extend</code> appends a specified list of fields to the input. All existing\nfields remain intact.</p>\n<p>The difference between <code>extend</code> and <a href="put.md"><code>put</code></a> is that <code>put</code> drops all\nfields not explicitly specified, whereas <code>extend</code> only appends fields.</p>\n<p>The difference between <code>extend</code> and <a href="replace.md"><code>replace</code></a> is that <code>replace</code>\noverwrites existing fields, whereas <code>extend</code> doesn\'t touch the input.</p>\n<h3><code>&#x3C;field=operand></code></h3>\n<p>The assignment consists of <code>field</code> that describes the new field name and\n<code>operand</code> that defines the field value.</p>\n<h3>Examples</h3>\n<p>Add new fields with fixed values:</p>\n<pre><code>extend secret="xxx", ints=[1, 2, 3], strs=["a", "b", "c"]\n</code></pre>\n<p>Duplicate a column:</p>\n<pre><code>extend source=src_ip\n</code></pre>',
138
+ docLink: "https://docs.tenzir.com/operators/transformations/extend",
139
+ },
140
+ {
141
+ label: "flatten",
142
+ type: "keyword",
143
+ detail: "Flattens nested data.",
144
+ processedHTML:
145
+ '<h2>Synopsis</h2>\n<pre><code>flatten [&#x3C;separator>]\n</code></pre>\n<h2>Description</h2>\n<p>The <code>flatten</code> operator acts on <a href="../../data-model/type-system.md">container\ntypes</a>:</p>\n<ol>\n<li><strong>Records</strong>: Join nested records with a separator (<code>.</code> by default). For\nexample, if a field named <code>x</code> is a record with fields <code>a</code> and <code>b</code>, flattening\nwill lift the nested record into the parent scope by creating two new fields\n<code>x.a</code> and <code>x.b</code>.</li>\n<li><strong>Lists</strong>: Merge nested lists into a single (flat) list. For example,\n<code>[[[2]], [[3, 1]], [[4]]]</code> becomes <code>[2, 3, 1, 4]</code>.</li>\n</ol>\n<p>For records inside lists, <code>flatten</code> "pushes lists down" into one list per record\nfield. For example, the record</p>\n<pre><code class="language-json">{\n "foo": [\n {\n "a": 2,\n "b": 1\n },\n {\n "a": 4\n }\n ]\n}\n</code></pre>\n<p>becomes</p>\n<pre><code class="language-json">{\n "foo.a": [2, 4],\n "foo.b": [1, null]\n}\n</code></pre>\n<p>Lists nested in records that are nested in lists will also be flattened. For\nexample, the record</p>\n<pre><code class="language-json">{\n "foo": [\n {\n "a": [\n [2, 23],\n [1,16]\n ],\n "b": [1]\n },\n {\n "a": [[4]]\n }\n ]\n}\n</code></pre>\n<p>becomes</p>\n<pre><code class="language-json">{\n "foo.a": [\n 2,\n 23,\n 1,\n 16,\n 4\n ],\n "foo.b": [\n 1\n ]\n}\n</code></pre>\n<p>As you can see from the above examples, flattening also removes <code>null</code> values.</p>\n<h3><code>&#x3C;separator></code></h3>\n<p>The separator string to join the field names of nested records.</p>\n<p>Defaults to <code>.</code>.</p>\n<h2>Examples</h2>\n<p>Consider the following record:</p>\n<pre><code class="language-json">{\n "src_ip": "147.32.84.165",\n "src_port": 1141,\n "dest_ip": "147.32.80.9",\n "dest_port": 53,\n "event_type": "dns",\n "dns": {\n "type": "query",\n "id": 553,\n "rrname": "irc.freenode.net",\n "rrtype": "A",\n "tx_id": 0,\n "grouped": {\n "A": ["tenzir.com", null]\n }\n }\n}\n</code></pre>\n<p>After <code>flatten</code> the record looks as follows:</p>\n<pre><code class="language-json">{\n "src_ip": "147.32.84.165",\n "src_port": 1141,\n "dest_ip": "147.32.80.9",\n "dest_port": 53,\n "event_type": "dns",\n "dns.type": "query",\n "dns.id": 553,\n "dns.rrname": "irc.freenode.net",\n "dns.rrtype": "A",\n "dns.tx_id": 0,\n "dns.grouped.A": ["tenzir.com"]\n}\n</code></pre>\n<p>Note that <code>dns.grouped.A</code> no longer contains a <code>null</code> value.</p>',
146
+ docLink: "https://docs.tenzir.com/operators/transformations/flatten",
147
+ },
148
+ {
149
+ label: "hash",
150
+ type: "keyword",
151
+ detail: "Computes a SHA256 hash digest of a given field.",
152
+ processedHTML:
153
+ '<div class="remark-container warning"><div class="remark-container-title warning">Deprecated</div><p>This operator will soon be removed in favor of first-class support for functions\nthat can be used in a variety of different operators and contexts.</p></div>\n<h2>Synopsis</h2>\n<pre><code>hash [-s|--salt=&#x3C;string>] &#x3C;field>\n</code></pre>\n<h2>Description</h2>\n<p>The <code>hash</code> operator calculates a hash digest of a given field.</p>\n<h3><code>&#x3C;-s|--salt>=&#x3C;string></code></h3>\n<p>A salt value for the hash.</p>\n<h3><code>&#x3C;field></code></h3>\n<p>The field over which the hash is computed.</p>\n<h2>Examples</h2>\n<p>Hash all values of the field <code>username</code> using the salt value <code>"xxx"</code> and store\nthe digest in a new field <code>username_hashed</code>:</p>\n<pre><code>hash --salt="B3IwnumKPEJDAA4u" username\n</code></pre>',
154
+ docLink: "https://docs.tenzir.com/operators/transformations/hash",
155
+ },
156
+ {
157
+ label: "head",
158
+ type: "keyword",
159
+ detail: "Limits the input to the first N events.",
160
+ processedHTML:
161
+ "<h2>Synopsis</h2>\n<pre><code>head [&#x3C;limit>]\n</code></pre>\n<h2>Description</h2>\n<p>The semantics of the <code>head</code> operator are the same of the equivalent Unix tool:\nprocess a fixed number of events from the input. The operator terminates\nafter it has reached its limit.</p>\n<h3><code>&#x3C;limit></code></h3>\n<p>An unsigned integer denoting how many events to keep.</p>\n<p>Defaults to 10.</p>\n<h2>Examples</h2>\n<p>Get the first ten events:</p>\n<pre><code>head\n</code></pre>\n<p>Get the first five events:</p>\n<pre><code>head 5\n</code></pre>",
162
+ docLink: "https://docs.tenzir.com/operators/transformations/head",
163
+ },
164
+ {
165
+ label: "measure",
166
+ type: "keyword",
167
+ detail: "Replaces the input with metrics describing the input.",
168
+ processedHTML:
169
+ '<h2>Synopsis</h2>\n<pre><code>measure [--real-time] [--cumulative]\n</code></pre>\n<h2>Description</h2>\n<p>The <code>measure</code> operator yields metrics for each received batch of events or bytes\nusing the following schema, respectively:</p>\n<pre><code class="language-title=&#x22;Events">type tenzir.metrics.events = record {\n timestamp: time,\n schema: string,\n schema_id: string,\n events: uint64,\n}\n</code></pre>\n<pre><code class="language-title=&#x22;Bytes">type tenzir.metrics.bytes = record {\n timestamp: time,\n bytes: uint64,\n}\n</code></pre>\n<h3><code>--real-time</code></h3>\n<p>Emit metrics immediately with every batch, rather than buffering until the\nupstream operator stalls, i.e., is idle or waiting for further input.</p>\n<p>The <code>--real-time</code> option is useful when inspect should emit data without\nlatency.</p>\n<h3><code>--cumulative</code></h3>\n<p>Emit running totals for the <code>events</code> and <code>bytes</code> fields rather than per-batch\nstatistics.</p>\n<h2>Examples</h2>\n<p>Get the number of bytes read incrementally for a file:</p>\n<pre><code class="language-json">{"timestamp": "2023-04-28T10:22:10.192322", "bytes": 16384}\n{"timestamp": "2023-04-28T10:22:10.223612", "bytes": 16384}\n{"timestamp": "2023-04-28T10:22:10.297169", "bytes": 16384}\n{"timestamp": "2023-04-28T10:22:10.387172", "bytes": 16384}\n{"timestamp": "2023-04-28T10:22:10.408171", "bytes": 8232}\n</code></pre>\n<p>Get the number of events read incrementally from a file:</p>\n<pre><code class="language-json">{"timestamp": "2023-04-28T10:26:45.159885", "events": 65536, "schema": "suricata.dns", "schema_id": "d49102998baae44a"}\n{"timestamp": "2023-04-28T10:26:45.812321", "events": 412, "schema": "suricata.dns", "schema_id": "d49102998baae44a"}\n</code></pre>\n<p>Get the total number of events in a file, grouped by schema:</p>\n<pre><code class="language-json">{"events": 65948, "schema": "suricata.dns"}\n</code></pre>',
170
+ docLink: "https://docs.tenzir.com/operators/transformations/measure",
171
+ },
172
+ {
173
+ label: "pass",
174
+ type: "keyword",
175
+ detail: "Does nothing with the input.",
176
+ processedHTML:
177
+ '<h2>Synopsis</h2>\n<pre><code>pass\n</code></pre>\n<h2>Description</h2>\n<p>The <code>pass</code> operator relays the input without any modification. It exists\nprimarily for testing and debugging.</p>\n<p>You can think of <code>pass</code> as the "identity" operator.</p>\n<h2>Examples</h2>\n<p>Forward the input without any changes:</p>\n<pre><code>pass\n</code></pre>',
178
+ docLink: "https://docs.tenzir.com/operators/transformations/pass",
179
+ },
180
+ {
181
+ label: "pseudonymize",
182
+ type: "keyword",
183
+ detail: "Pseudonymizes fields according to a given method.",
184
+ processedHTML:
185
+ '<div class="remark-container warning"><div class="remark-container-title warning">Deprecated</div><p>This operator will soon be removed in favor of first-class support for functions\nthat can be used in a variety of different operators and contexts.</p></div>\n<h2>Synopsis</h2>\n<pre><code>pseudonymize -m|--method=&#x3C;string> -s|--seed=&#x3C;seed> &#x3C;extractor>...\n</code></pre>\n<h2>Description</h2>\n<p>The <code>pseudonimize</code> operator replaces IP address using the\n<a href="https://en.wikipedia.org/wiki/Crypto-PAn">Crypto-PAn</a> algorithm.</p>\n<p>Currently, <code>pseudonimize</code> exclusively works for fields of type <code>ip</code>.</p>\n<h3><code>-m|--method=&#x3C;string></code></h3>\n<p>The algorithm for pseudonimization</p>\n<h3><code>-s|--seed=&#x3C;seed></code></h3>\n<p>A 64-byte seed that describes a hexadecimal value. When the seed is shorter than\n64 bytes, the operator will append zeros to match the size; when it is longer,\nit will truncate the seed.</p>\n<h3><code>&#x3C;extractor>...</code></h3>\n<p>The list of extractors describing fields to pseudonomize. If an extractor\nmatches types other than IP addresses, the operator will ignore them.</p>\n<h2>Example</h2>\n<p>Pseudonymize all values of the fields <code>src_ip</code> and <code>dest_ip</code> using the\n<code>crypto-pan</code> algorithm and <code>deadbeef</code> seed:</p>\n<pre><code>pseudonymize --method="crypto-pan" --seed="deadbeef" src_ip, dest_ip\n</code></pre>',
186
+ docLink: "https://docs.tenzir.com/operators/transformations/pseudonymize",
187
+ },
188
+ {
189
+ label: "put",
190
+ type: "keyword",
191
+ detail: "Returns new events that only contain a set of specified fields.",
192
+ processedHTML:
193
+ '<h2>Synopsis</h2>\n<pre><code>put &#x3C;field[=operand]>...\n</code></pre>\n<h2>Description</h2>\n<p>The <code>put</code> operator produces new events according to a specified list of fields.\nAll other fields are removed from the input.</p>\n<p>The difference between <code>put</code> and <a href="extend.md"><code>extend</code></a> is that <code>put</code> drops all\nfields not explicitly specified, whereas <code>extend</code> only appends fields.</p>\n<h3><code>&#x3C;field[=operand]></code></h3>\n<p>The <code>field</code> describes the name of the field to select. The extended form with an\n<code>operand</code> assignment allows for computing functions over existing fields.</p>\n<p>If the right-hand side of the assignment\nis omitted, the field name is implicitly used as an extractor. If multiple\nfields match the extractor, the first matching field is used in the output. If\nno fields match, <code>null</code> is assigned instead.</p>\n<h3>Examples</h3>\n<p>Overwrite values of the field <code>payload</code> with a fixed value:</p>\n<pre><code class="language-c">put payload="REDACTED"\n</code></pre>\n<p>Create connection 4-tuples:</p>\n<pre><code class="language-c">put src_ip, src_port, dst_ip, dst_port\n</code></pre>\n<p>Unlike <a href="select.md"><code>select</code></a>, <code>put</code> reorders fields. If the specified fields\ndo not exist in the input, <code>null</code> values will be assigned.</p>\n<p>You can also reference existing fields:</p>\n<pre><code class="language-c">put src_ip, src_port, dst_ip=dest_ip, dst_port=dest_port\n</code></pre>',
194
+ docLink: "https://docs.tenzir.com/operators/transformations/put",
195
+ },
196
+ {
197
+ label: "rare",
198
+ type: "keyword",
199
+ detail: "Shows the least common values. The dual to top.",
200
+ processedHTML:
201
+ "<h2>Synopsis</h2>\n<pre><code>rare &#x3C;field> [--count-field=&#x3C;count-field>|-c &#x3C;count-field>]\n</code></pre>\n<h2>Description</h2>\n<p>Shows the least common values for a given field. For each unique value, a new event containing its count will be produced.</p>\n<h3><code>&#x3C;field></code></h3>\n<p>The name of the field to find the least common values for.</p>\n<h3><code>--count-field=&#x3C;count-field>|-c &#x3C;count-field></code></h3>\n<p>An optional argument specifying the field name of the count field. Defaults to <code>count</code>.</p>\n<p>The count field and the value field must have different names.</p>\n<h2>Examples</h2>\n<p>Find the least common values for field <code>id.orig_h</code>.</p>\n<pre><code>rare id.orig_h\n</code></pre>\n<p>Find the least common values for field <code>count</code> and present the value amount in a field <code>amount</code>.</p>\n<pre><code>rare count --count-field=amount\n</code></pre>",
202
+ docLink: "https://docs.tenzir.com/operators/transformations/rare",
203
+ },
204
+ {
205
+ label: "read",
206
+ type: "keyword",
207
+ detail: "The read operator converts raw bytes into events.",
208
+ processedHTML:
209
+ '<h2>Synopsis</h2>\n<pre><code>read &#x3C;format>\n</code></pre>\n<h2>Description</h2>\n<p>The <code>read</code> operator parses events by interpreting its input bytes in a given\nformat.</p>\n<h3><code>&#x3C;format></code></h3>\n<p>The <a href="../../formats.md">format</a> used to convert raw bytes into events.</p>\n<p>Some formats have format-specific options. Please refer to the documentation of\nthe individual formats for more information.</p>\n<h2>Examples</h2>\n<p>Read the input bytes as Zeek TSV logs:</p>\n<pre><code>read zeek-tsv\n</code></pre>\n<p>Read the input bytes as Suricata Eve JSON:</p>\n<pre><code>read suricata\n</code></pre>',
210
+ docLink: "https://docs.tenzir.com/operators/transformations/read",
211
+ },
212
+ {
213
+ label: "rename",
214
+ type: "keyword",
215
+ detail: "Renames fields and types.",
216
+ processedHTML:
217
+ '<h2>Synopsis</h2>\n<pre><code>rename &#x3C;name=extractor>...\n</code></pre>\n<h2>Description</h2>\n<p>The <code>rename</code> operator assigns new names to fields or types. Renaming only\nmodifies metadata and is therefore computationally inexpensive. The operator\nhandles nested field extractors as well, but cannot perform field reordering,\ne.g., by hoisting nested fields into the top level.</p>\n<p>Renaming only takes place if the provided extractor on the right-hand side of\nthe assignment resolves to a field or type. Otherwise the assignment does\nnothing. If no extractors match, <code>rename</code> degenerates to <a href="pass.md"><code>pass</code></a>.</p>\n<h3><code>&#x3C;name=extractor>...</code></h3>\n<p>An assignment of the form <code>name=extractor</code> renames the field or type identified\nby <code>extractor</code> to <code>name</code>.</p>\n<h2>Examples</h2>\n<p>Rename events of type <code>suricata.flow</code> to <code>connection</code>:</p>\n<pre><code>rename connection=:suricata.flow\n</code></pre>\n<p>Assign new names to the fields <code>src_ip</code> and <code>dest_ip</code>:</p>\n<pre><code>rename src=src_ip, dst=dest_ip\n</code></pre>\n<p>Give the nested field <code>orig_h</code> nested under the record <code>id</code> the name <code>src_ip</code>:</p>\n<pre><code>rename src=id.orig_h\n</code></pre>\n<p>Same as above, but consider fields at any nesting hierarchy:</p>\n<pre><code>rename src=orig_h\n</code></pre>',
218
+ docLink: "https://docs.tenzir.com/operators/transformations/rename",
219
+ },
220
+ {
221
+ label: "repeat",
222
+ type: "keyword",
223
+ detail: "Repeats the input a number of times.",
224
+ processedHTML:
225
+ '<h2>Synopsis</h2>\n<pre><code>repeat [&#x3C;repetitions>]\n</code></pre>\n<h2>Description</h2>\n<p>The <code>repeat</code> operator relays the input without any modification, and repeats its\ninputs a specified number of times. It is primarily used for testing and when\nworking with generated data.</p>\n<p>The repeat operator keeps its input in memory. Avoid using it to repeat large\ndata sets.</p>\n<h3><code>&#x3C;repetitions></code></h3>\n<p>The number of times to repeat the input data.</p>\n<p>If not specified, the operator repeats its input indefinitely.</p>\n<h2>Examples</h2>\n<p>Given the following events as JSON:</p>\n<pre><code class="language-json">{"number": 1, "text": "one"}\n{"number": 2, "text": "two"}\n</code></pre>\n<p>The <code>repeat</code> operator will repeat them indefinitely, in order:</p>\n<pre><code>repeat\n</code></pre>\n<pre><code class="language-json">{"number": 1, "text": "one"}\n{"number": 2, "text": "two"}\n{"number": 1, "text": "one"}\n{"number": 2, "text": "two"}\n{"number": 1, "text": "one"}\n{"number": 2, "text": "two"}\n// …\n</code></pre>\n<p>To just repeat the first event 5 times, use:</p>\n<pre><code>head 1 | repeat 5\n</code></pre>\n<pre><code class="language-json">{"number": 1, "text": "one"}\n{"number": 1, "text": "one"}\n{"number": 1, "text": "one"}\n{"number": 1, "text": "one"}\n{"number": 1, "text": "one"}\n</code></pre>',
226
+ docLink: "https://docs.tenzir.com/operators/transformations/repeat",
227
+ },
228
+ {
229
+ label: "replace",
230
+ type: "keyword",
231
+ detail:
232
+ "Replaces the fields matching the given extractors with fixed values.",
233
+ processedHTML:
234
+ '<h2>Synopsis</h2>\n<pre><code>replace &#x3C;extractor=operand>...\n</code></pre>\n<h2>Description</h2>\n<p>The <code>replace</code> operator mutates existing fields by providing a new value.</p>\n<p>The difference between <code>replace</code> and <a href="extend.md"><code>extend</code></a> is that <code>replace</code>\noverwrites existing fields, whereas <code>extend</code> doesn\'t touch the input.</p>\n<h3><code>&#x3C;extractor=operand></code></h3>\n<p>The assignment consists of an <code>extractor</code> that matches against existing fields\nand an <code>operand</code> that defines the new field value.</p>\n<p>If <code>field</code> does not exist in the input, the operator degenerates to\n<a href="pass.md"><code>pass</code></a>.</p>\n<h3>Examples</h3>\n<p>Replace the field the field <code>src_ip</code> with a fixed value:</p>\n<pre><code>replace src_ip=0.0.0.0\n</code></pre>\n<p>Replace all IP address with a fixed value:</p>\n<pre><code>replace :ip=0.0.0.0\n</code></pre>',
235
+ docLink: "https://docs.tenzir.com/operators/transformations/replace",
236
+ },
237
+ {
238
+ label: "select",
239
+ type: "keyword",
240
+ detail: "Selects fields from the input.",
241
+ processedHTML:
242
+ '<h2>Synopsis</h2>\n<pre><code>select &#x3C;extractor>...\n</code></pre>\n<h2>Description</h2>\n<p>The <code>select</code> operator keeps only the fields matching the provided extractors and\nremoves all other fields. It is the dual to <a href="drop.md"><code>drop</code></a>.</p>\n<p>In relational algebra, <code>select</code> performs a <em>projection</em> of the provided\narguments.</p>\n<h3><code>&#x3C;extractor>...</code></h3>\n<p>A comma-separated list of extractors that identify the fields to keep.</p>\n<h2>Examples</h2>\n<p>Only keep fields <code>foo</code> and <code>bar</code>:</p>\n<pre><code>select foo, bar\n</code></pre>\n<p>Select all fields of type <code>ip</code>:</p>\n<pre><code>select :ip\n</code></pre>',
243
+ docLink: "https://docs.tenzir.com/operators/transformations/select",
244
+ },
245
+ {
246
+ label: "shell",
247
+ type: "keyword",
248
+ detail:
249
+ "Executes a system command and hooks its raw stdin and stdout into the pipeline.",
250
+ processedHTML:
251
+ '<h2>Synopsis</h2>\n<pre><code>shell &#x3C;command>\n</code></pre>\n<h2>Description</h2>\n<p>The <code>shell</code> operator executes the provided command by spawning a new process.\nThe input of the operator is forwarded to the child\'s standard input. Similarly,\nthe child\'s standard output is forwarded to the output of the operator.</p>\n<p>You can also use <a href="../sources/shell.md"><code>shell</code> as source operator</a>.</p>\n<h3><code>&#x3C;command></code></h3>\n<p>The command to execute and hook into the pipeline processing.</p>\n<p>The value of <code>command</code> is a single string. If you would like to pass a command\nline as you would on the shell, use single or double quotes for escaping, e.g.,\n<code>shell \'jq -C\'</code> or <code>shell "jq -C"</code>. The command is interpreted by <code>/bin/sh -c</code>.</p>\n<h2>Examples</h2>\n<p>Consider the use case of converting CSV to JSON:</p>\n<pre><code class="language-bash">tenzir \'read csv | write json\' | jq -C\n</code></pre>\n<p>The <code>write json</code> operator produces NDJSON. Piping this output to <code>jq</code> generates a\ncolored, tree-structured variation that is (arguably) easier to read. Using the\n<code>shell</code> operator, you can integrate Unix tools that rely on\nstdin/stdout for input/output as "native" operators that process raw bytes. For\nexample, in this pipeline:</p>\n<pre><code>write json | save stdout\n</code></pre>\n<p>The <a href="../transformations/write.md"><code>write</code></a> operator produces raw bytes and\n<a href="../sinks/save.md"><code>save</code></a> accepts raw bytes. The <code>shell</code> operator therefore\nfits right in the middle:</p>\n<pre><code>write json | shell "jq -C" | save stdout\n</code></pre>\n<p>Using <a href="../user-defined.md">user-defined operators</a>, we can expose this\n(potentially verbose) post-processing more succinctly in the pipeline language:</p>\n<pre><code class="language-yaml">tenzir:\n operators:\n jsonize:\n write json | shell "jq -C" | save stdout\n</code></pre>\n<p>Now you can use <code>jsonize</code> as a custom operator in a pipeline:</p>\n<pre><code class="language-bash">tenzir \'read csv | where field > 42 | jsonize\' &#x3C; file.csv\n</code></pre>\n<p>This mechanism allows for wrapping also more complex invocation of tools.\n<a href="https://zeek.org">Zeek</a>, for example, converts packets into structured network\nlogs. Tenzir already has support for consuming Zeek output with the formats\n<a href="../../formats/zeek-json.md"><code>zeek-json</code></a> and\n<a href="../../formats/zeek-tsv.md"><code>zeek-tsv</code></a>. But that requires attaching yourself\ndownstream of a Zeek instance. Sometimes you want instant Zeek analytics given a\nPCAP trace.</p>\n<p>With the <code>shell</code> operator, you can script a Zeek invocation and readily\npost-process the output with a rich set of operators, to filter, reshape,\nenrich, or route the logs as structured data. Let\'s define a <code>zeek</code> operator for\nthat:</p>\n<pre><code class="language-yaml">tenzir:\n operators:\n zeek:\n shell "zeek -r - LogAscii::output_to_stdout=T\n JSONStreaming::disable_default_logs=T\n JSONStreaming::enable_log_rotation=F\n json-streaming-logs"\n | read zeek-json\n</code></pre>\n<p>Processing a PCAP trace now is a matter of calling the <code>zeek</code> operator:</p>\n<pre><code class="language-bash">gunzip -c example.pcap.gz |\n tenzir \'zeek | select id.orig_h, id.orig_p, id.resp_h | head 3\'\n</code></pre>\n<pre><code class="language-json">{"id": {"orig_h": null, "resp_h": null, "resp_p": null}}\n{"id": {"orig_h": "192.168.168.100", "resp_h": "83.135.95.78", "resp_p": 0}}\n{"id": {"orig_h": "192.168.168.100", "resp_h": "83.135.95.78", "resp_p": 22}}\n</code></pre>\n<p>NB: because <code>zeek</code> (= <code>shell</code>) reads bytes, we can drop the implicit <code>load stdin</code> source operator in this pipeline.</p>',
252
+ docLink: "https://docs.tenzir.com/operators/transformations/shell",
253
+ },
254
+ {
255
+ label: "sigma",
256
+ type: "keyword",
257
+ detail:
258
+ "Filter the input with \\[Sigma rules]\\[sigma] and output matching events.",
259
+ processedHTML:
260
+ '<div class="remark-container caution"><div class="remark-container-title caution">Experimental</div><p>This operator is experimental and subject to change without notice, even in\nminor or patch releases.</p></div>\n<h2>Synopsis</h2>\n<pre><code>sigma &#x3C;rule> [--refresh-interval &#x3C;refresh-interval>]\nsigma &#x3C;directory> [--refresh-interval &#x3C;refresh-interval>]\n</code></pre>\n<h2>Description</h2>\n<p>The <code>sigma</code> operator executes <a href="https://github.com/SigmaHQ/sigma">Sigma rules</a> on\nits input. If a rule matches, the operator emits a <code>tenzir.sigma</code> event that\nwraps the input record into a new record along with the matching rule. The\noperator discards all events that do not match the provided rules.</p>\n<p>For each rule, the operator transpiles the YAML into an\n<a href="../../language/expressions.md">expression</a> and instantiates a\n<a href="where.md"><code>where</code></a> operator, followed by <a href="put.md"><code>put</code></a> to generate an output.\nHere\'s how the transpilation works. The Sigma rule YAML format requires a\n<code>detection</code> attribute that includes a map of named sub-expression called <em>search\nidentifiers</em>. In addition, <code>detection</code> must include a final <code>condition</code> that\ncombines search identifiers using boolean algebra (AND, OR, and NOT) or\nsyntactic sugar to reference groups of search expressions, e.g., using the\n<code>1/all of *</code> or plain wildcard syntax. Consider the following <code>detection</code>\nembedded in a rule:</p>\n<pre><code class="language-yaml">detection:\n foo:\n a: 42\n b: "evil"\n bar:\n c: 1.2.3.4\n condition: foo or not bar\n</code></pre>\n<p>We translate this rule piece by building a symbol table of all keys (<code>foo</code> and\n<code>bar</code>). Each sub-expression is a valid expression in itself:</p>\n<ol>\n<li><code>foo</code>: <code>a == 42 &#x26;&#x26; b == "evil"</code></li>\n<li><code>bar</code>: <code>c == 1.2.3.4</code></li>\n</ol>\n<p>Finally, we combine the expression according to <code>condition</code>:</p>\n<pre><code class="language-c">(a == 42 &#x26;&#x26; b == "evil") || ! (c == 1.2.3.4)\n</code></pre>\n<p>We parse the YAML string values according to Tenzir\'s richer data model, e.g.,\nthe expression <code>c: 1.2.3.4</code> becomes a field named <code>c</code> and value <code>1.2.3.4</code> of\ntype <code>ip</code>, rather than a <code>string</code>. Sigma also comes with its own <a href="https://github.com/SigmaHQ/sigma-specification/blob/main/Taxonomy_specification.md">event\ntaxonomy</a>\nto standardize field names. The <code>sigma</code> operator currently does not normalize\nfields according to this taxonomy but rather takes the field names verbatim from\nthe search identifier.</p>\n<p>Sigma uses <a href="https://github.com/SigmaHQ/sigma-specification/blob/main/Sigma_specification.md#value-modifiers">value\nmodifiers</a>\nto select a concrete relational operator for given search predicate. Without a\nmodifier, Sigma uses equality comparison (<code>==</code>) of field and value. For example,\nthe <code>contains</code> modifier changes the relational operator to substring search, and\nthe <code>re</code> modifier switches to a regular expression match. The table below shows\nwhat modifiers the <code>sigma</code> operator supports, where ✅ means implemented, 🚧 not\nyet implemented but possible, and ❌ not yet supported:</p>\n<p>|Modifier|Use|sigmac|Tenzir|\n|--------|---|:----:|:--:|\n|<code>contains</code>|perform a substring search with the value|✅|✅|\n|<code>startswith</code>|match the value as a prefix|✅|✅|\n|<code>endswith</code>|match the value as a suffix|✅|✅|\n|<code>base64</code>|encode the value with Base64|✅|✅\n|<code>base64offset</code>|encode value as all three possible Base64 variants|✅|✅\n|<code>utf16le</code>/<code>wide</code>|transform the value to UTF16 little endian|✅|🚧\n|<code>utf16be</code>|transform the value to UTF16 big endian|✅|🚧\n|<code>utf16</code>|transform the value to UTF16|✅|🚧\n|<code>re</code>|interpret the value as regular expression|✅|✅\n|<code>cidr</code>|interpret the value as a IP CIDR|❌|✅\n|<code>all</code>|changes the expression logic from OR to AND|✅|✅\n|<code>lt</code>|compare less than (<code>&#x3C;</code>) the value|❌|✅\n|<code>lte</code>|compare less than or equal to (<code>&#x3C;=</code>) the value|❌|✅\n|<code>gt</code>|compare greater than (<code>></code>) the value|❌|✅\n|<code>gte</code>|compare greater than or equal to (<code>>=</code>) the value|❌|✅\n|<code>expand</code>|expand value to placeholder strings, e.g., <code>%something%</code>|❌|❌</p>\n<h3><code>&#x3C;rule.yaml></code></h3>\n<p>The rule to match.</p>\n<p>This invocation transpiles <code>rule.yaml</code> at the time of pipeline creation.</p>\n<h3><code>&#x3C;directory></code></h3>\n<p>The directory to watch.</p>\n<p>This invocation watches a directory and attempts to parse each contained file as\na Sigma rule. The <code>sigma</code> operator matches if <em>any</em> of the contained rules\nmatch, effectively creating a disjunction of all rules inside the directory.</p>\n<h3><code>--refresh-interval &#x3C;refresh-interval></code></h3>\n<p>How often the Sigma operator looks at the specified rule or directory of rules\nto update its internal state.</p>\n<p>Defaults to 5 seconds.</p>\n<h2>Examples</h2>\n<p>Apply a Sigma rule to an EVTX file using\n<a href="https://github.com/omerbenamram/evtx"><code>evtx_dump</code></a>:</p>\n<pre><code class="language-bash">evtx_dump -o jsonl file.evtx | tenzir \'read json | sigma rule.yaml\'\n</code></pre>\n<p>Apply a Sigma rule over historical data in a node from the last day:</p>\n<pre><code>export | where :timestamp > 1 day ago | sigma rule.yaml\n</code></pre>\n<p>Watch a directory of Sigma rules and apply all of them on a continuous stream of\nSuricata events:</p>\n<pre><code>from file --follow read suricata | sigma /tmp/rules/\n</code></pre>\n<p>When you add a new file to <code>/tmp/rules</code>, the <code>sigma</code> operator transpiles it and\nwill match it on all subsequent inputs.</p>',
261
+ docLink: "https://docs.tenzir.com/operators/transformations/sigma",
262
+ },
263
+ {
264
+ label: "sort",
265
+ type: "keyword",
266
+ detail: "Sorts events.",
267
+ processedHTML:
268
+ '<h2>Synopsis</h2>\n<pre><code>sort [--stable] &#x3C;field> [&#x3C;asc>|&#x3C;desc>] [&#x3C;nulls-first>|&#x3C;nulls-last>]\n</code></pre>\n<h2>Description</h2>\n<p>Sorts events by a provided field.</p>\n<div class="remark-container caution"><div class="remark-container-title caution">Work in Progress</div><p>The implementation of the <code>sort</code> operator currently only works with field names.\nWe plan to support sorting by meta data, and more generally, entire expressions.\nTo date, the operator also lacks support sorting <code>subnet</code> fields.</p></div>\n<h3><code>--stable</code></h3>\n<p>Preserve the relative order of events that cannot be sorted because the provided\nfields resolve to the same value.</p>\n<h3><code>&#x3C;field></code></h3>\n<p>The name of the field to sort by.</p>\n<h3><code>&#x3C;asc>|&#x3C;desc></code></h3>\n<p>Specifies the sort order.</p>\n<p>Defaults to <code>asc</code>.</p>\n<h3><code>&#x3C;nulls-first>|&#x3C;nulls-last></code></h3>\n<p>Specifies how to order null values.</p>\n<p>Defaults to <code>nulls-last</code>.</p>\n<h2>Examples</h2>\n<p>Sort by the <code>timestamp</code> field in ascending order.</p>\n<pre><code>sort timestamp\n</code></pre>\n<p>Sort by the <code>timestamp</code> field in descending order.</p>\n<pre><code>sort timestamp desc\n</code></pre>\n<p>Arrange by field <code>foo</code> and put null values first:</p>\n<pre><code>sort foo nulls-first\n</code></pre>\n<p>Arrange by field <code>foo</code> in descending order and put null values first:</p>\n<pre><code>sort foo desc nulls-first\n</code></pre>',
269
+ docLink: "https://docs.tenzir.com/operators/transformations/sort",
270
+ },
271
+ {
272
+ label: "summarize",
273
+ type: "keyword",
274
+ detail: "Groups events and applies aggregate functions on each group.",
275
+ processedHTML:
276
+ "<h2>Synopsis</h2>\n<pre><code>summarize &#x3C;[field=]aggregation>... [by &#x3C;extractor>... [resolution &#x3C;duration>]]\n</code></pre>\n<h2>Description</h2>\n<p>The <code>summarize</code> operator groups events according to a grouping expression and\napplies an aggregation function over each group. The operator consumes the\nentire input before producing an output.</p>\n<p>Fields that neither occur in an aggregation function nor in the <code>by</code> list\nare dropped from the output.</p>\n<h3><code>[field=]aggregation</code></h3>\n<p>Aggregation functions compute a single value of one or more columns in a given\ngroup. Syntactically, <code>aggregation</code> has the form <code>f(x)</code> where <code>f</code> is the\naggregation function and <code>x</code> is a field.</p>\n<p>By default, the name for the new field <code>aggregation</code> is its string\nrepresentation, e.g., <code>min(timestamp)</code>. You can specify a different name by\nprepending a field assignment, e.g., <code>min_ts=min(timestamp)</code>.</p>\n<p>The following aggregation functions are available:</p>\n<ul>\n<li><code>sum</code>: Computes the sum of all grouped values.</li>\n<li><code>min</code>: Computes the minimum of all grouped values.</li>\n<li><code>max</code>: Computes the maximum of all grouped values.</li>\n<li><code>any</code>: Computes the disjunction (OR) of all grouped values. Requires the\nvalues to be booleans.</li>\n<li><code>all</code>: Computes the conjunction (AND) of all grouped values. Requires the\nvalues to be booleans.</li>\n<li><code>distinct</code>: Creates a sorted list of all unique grouped values that are not\nnull.</li>\n<li><code>sample</code>: Takes the first of all grouped values that is not null.</li>\n<li><code>count</code>: Counts all grouped values that are not null.</li>\n<li><code>count_distinct</code>: Counts all distinct grouped values that are not null.</li>\n</ul>\n<h3><code>by &#x3C;extractor></code></h3>\n<p>The extractors specified after the optional <code>by</code> clause partition the input into\ngroups. If <code>by</code> is omitted, all events are assigned to the same group.</p>\n<h3><code>resolution &#x3C;duration></code></h3>\n<p>The <code>resolution</code> option specifies an optional duration value that specifies the\ntolerance when comparing time values in the <code>group-by</code> section. For example,\n<code>01:48</code> is rounded down to <code>01:00</code> when a 1-hour <code>resolution</code> is used.</p>\n<p>NB: we introduced the <code>resolution</code> option as a stop-gap measure to compensate for\nthe lack of a rounding function. The ability to apply functions in the grouping\nexpression will replace this option in the future.</p>\n<h2>Examples</h2>\n<p>Group the input by <code>src_ip</code> and aggregate all unique <code>dest_port</code> values into a\nlist:</p>\n<pre><code>summarize distinct(dest_port) by src_ip\n</code></pre>\n<p>Same as above, but produce a count of the unique number of values instead of a\nlist:</p>\n<pre><code>summarize count_distinct(dest_port) by src_ip\n</code></pre>\n<p>Compute minimum, maximum of the <code>timestamp</code> field per <code>src_ip</code> group:</p>\n<pre><code>summarize min(timestamp), max(timestamp) by src_ip\n</code></pre>\n<p>Compute minimum, maximum of the <code>timestamp</code> field over all events:</p>\n<pre><code>summarize min(timestamp), max(timestamp)\n</code></pre>\n<p>Create a boolean flag <code>originator</code> that is <code>true</code> if any value in the group is\n<code>true</code>:</p>\n<pre><code>summarize originator=any(is_orig) by src_ip\n</code></pre>\n<p>Create 1-hour groups and produce a summary of network traffic between host\npairs:</p>\n<pre><code>summarize sum(bytes_in), sum(bytes_out) by ts, src_ip, dest_ip resolution 1 hour\n</code></pre>",
277
+ docLink: "https://docs.tenzir.com/operators/transformations/summarize",
278
+ },
279
+ {
280
+ label: "tail",
281
+ type: "keyword",
282
+ detail: "Limits the input to the last N events.",
283
+ processedHTML:
284
+ "<h2>Synopsis</h2>\n<pre><code>tail [&#x3C;limit>]\n</code></pre>\n<h2>Description</h2>\n<p>The semantics of the <code>tail</code> operator are the same of the equivalent Unix tool:\nconsume all input and only display the last <em>N</em> events.</p>\n<h3><code>&#x3C;limit></code></h3>\n<p>An unsigned integer denoting how many events to keep. Defaults to 10.</p>\n<p>Defaults to 10.</p>\n<h2>Examples</h2>\n<p>Get the last ten results:</p>\n<pre><code>tail\n</code></pre>\n<p>Get the last five results:</p>\n<pre><code>tail 5\n</code></pre>",
285
+ docLink: "https://docs.tenzir.com/operators/transformations/tail",
286
+ },
287
+ {
288
+ label: "taste",
289
+ type: "keyword",
290
+ detail: "Limits the input to N events per unique schema.",
291
+ processedHTML:
292
+ '<h2>Synopsis</h2>\n<pre><code>taste [&#x3C;limit>]\n</code></pre>\n<h2>Description</h2>\n<p>The <code>taste</code> operator provides an exemplary overview of the "shape" of the data\ndescribed by the pipeline. This helps to understand the diversity of the\nresult, especially when interactively exploring data. Usually, the first <em>N</em>\nevents are returned, but this is not guaranteed.</p>\n<h3><code>&#x3C;limit></code></h3>\n<p>An unsigned integer denoting how many events to keep per schema.</p>\n<p>Defaults to 10.</p>\n<h2>Examples</h2>\n<p>Get 10 results of each unique schema:</p>\n<pre><code>taste\n</code></pre>\n<p>Get one sample for every unique event type:</p>\n<pre><code>taste 1\n</code></pre>',
293
+ docLink: "https://docs.tenzir.com/operators/transformations/taste",
294
+ },
295
+ {
296
+ label: "top",
297
+ type: "keyword",
298
+ detail: "Shows the most common values. The dual to rare.",
299
+ processedHTML:
300
+ "<h2>Synopsis</h2>\n<pre><code>top &#x3C;field> [--count-field=&#x3C;count-field>|-c &#x3C;count-field>]\n</code></pre>\n<h2>Description</h2>\n<p>Shows the most common values for a given field. For each unique value, a new event containing its count will be produced.</p>\n<h3><code>&#x3C;field></code></h3>\n<p>The name of the field to find the most common values for.</p>\n<h3><code>--count-field=&#x3C;count-field>|-c &#x3C;count-field></code></h3>\n<p>An optional argument specifying the field name of the count field. Defaults to <code>count</code>.</p>\n<p>The count field and the value field must have different names.</p>\n<h2>Examples</h2>\n<p>Find the most common values for field <code>id.orig_h</code>.</p>\n<pre><code>top id.orig_h\n</code></pre>\n<p>Find the most common values for field <code>count</code> and present the value amount in a field <code>amount</code>.</p>\n<pre><code>top count --count-field=amount\n</code></pre>",
301
+ docLink: "https://docs.tenzir.com/operators/transformations/top",
302
+ },
303
+ {
304
+ label: "unflatten",
305
+ type: "keyword",
306
+ detail:
307
+ "Unflattens data structures whose field names imply a nested structure.",
308
+ processedHTML:
309
+ '<h2>Synopsis</h2>\n<pre><code>unflatten [&#x3C;separator>]\n</code></pre>\n<h2>Description</h2>\n<p>The <code>unflatten</code> operator creates nested records out of record entries whose\nnames include a separator, thus unflattening</p>\n<div class="remark-container info"><p><code>unflatten</code> uses a heuristic to determine the unflattened schema. Thus, the\nschema of a record that has been flattened using the <a href="flatten.md"><code>flatten</code></a> operator and\nunflattened afterwards may not be identical to the schema of the unmodified\nrecord.</p></div>\n<h3><code>&#x3C;separator></code></h3>\n<p>The separator string to unflatten records with.</p>\n<p>Defaults to <code>.</code>.</p>\n<h2>Examples</h2>\n<p>Consider the following data:</p>\n<pre><code class="language-json">{\n "src_ip": "147.32.84.165",\n "src_port": 1141,\n "dest_ip": "147.32.80.9",\n "dest_port": 53,\n "event_type": "dns",\n "dns.type": "query",\n "dns.id": 553,\n "dns.rrname": "irc.freenode.net",\n "dns.rrtype": "A",\n "dns.tx_id": 0,\n "dns.grouped.A": ["tenzir.com"]\n}\n</code></pre>\n<p>The <code>unflatten</code> operator recreates nested records from fields that contain the <code>.</code>\nseparator:</p>\n<pre><code class="language-json">{\n "src_ip": "147.32.84.165",\n "src_port": 1141,\n "dest_ip": "147.32.80.9",\n "dest_port": 53,\n "event_type": "dns",\n "dns": {\n "type": "query",\n "id": 553,\n "rrname": "irc.freenode.net",\n "rrtype": "A",\n "tx_id": 0,\n "grouped": {\n "A": [\n "tenzir.com"\n ]\n }\n }\n}\n</code></pre>',
310
+ docLink: "https://docs.tenzir.com/operators/transformations/unflatten",
311
+ },
312
+ {
313
+ label: "unique",
314
+ type: "keyword",
315
+ detail: "Removes adjacent duplicates.",
316
+ processedHTML:
317
+ '<h2>Synopsis</h2>\n<pre><code>unique\n</code></pre>\n<h2>Description</h2>\n<p>The <code>unique</code> operator deduplicates adjacent values, similar to the Unix tool\n<code>uniq</code>.</p>\n<p>A frequent use case is <a href="select.md">selecting a set of fields</a>, <a href="sort.md">sorting the\ninput</a>, and then removing duplicates from the input.</p>\n<h2>Examples</h2>\n<p>Consider the following data:</p>\n<pre><code class="language-json">{"foo": 1, "bar": "a"}\n{"foo": 1, "bar": "a"}\n{"foo": 1, "bar": "a"}\n{"foo": 1, "bar": "b"}\n{"foo": null, "bar": "b"}\n{"bar": "b"}\n{"foo": null, "bar": "b"}\n{"foo": null, "bar": "b"}\n</code></pre>\n<p>The <code>unique</code> operator removes adjacent duplicates and produces the following output:</p>\n<pre><code class="language-json">{"foo": 1, "bar": "a"}\n{"foo": 1, "bar": "b"}\n{"foo": null, "bar": "b"}\n{"bar": "b"}\n{"foo": null, "bar": "b"}\n</code></pre>\n<p>Note that the output still contains the event <code>{"foo": null, "bar": "b"}</code> twice.\nThis is because <code>unique</code> only removes <em>adjacent</em> duplicates.</p>\n<p>To remove <em>all</em> duplicates (including non-adjacent ones), <a href="sort.md"><code>sort</code></a>\nthe input first such that duplicate values lay adjacent to each other. Unlike\ndeduplication via <code>unique</code>, sorting is a blocking and operation and consumes\nthe entire input before producing outputs.</p>',
318
+ docLink: "https://docs.tenzir.com/operators/transformations/unique",
319
+ },
320
+ {
321
+ label: "where",
322
+ type: "keyword",
323
+ detail: "Filters events according to an expression.",
324
+ processedHTML:
325
+ '<h2>Synopsis</h2>\n<pre><code>where &#x3C;expression>\n</code></pre>\n<h2>Description</h2>\n<p>The <code>where</code> operator only keeps events that match the provided\n<a href="../../language/expressions.md">expression</a> and discards all other events.</p>\n<p>Use <code>where</code> to extract the subset of interest of the data. Tenzir\'s expression\nlanguage offers various ways to describe the desired data. In particular,\nexpressions work <em>across schemas</em> and thus make it easy to concisely articulate\nconstraints.</p>\n<h3><code>&#x3C;expression></code></h3>\n<p>The <a href="../../language/expressions.md">expression</a> to evaluate for each event.</p>\n<h2>Examples</h2>\n<p>Select all events that contain a field with the value <code>1.2.3.4</code>:</p>\n<pre><code>where 1.2.3.4\n</code></pre>\n<p>This expression internally completes to <code>:ip == 1.2.3.4</code>. The type extractor\n<code>:ip</code> describes all fields of type <code>ip</code>. Use field extractors to only consider a\nsingle field:</p>\n<pre><code>where src_ip == 1.2.3.4\n</code></pre>\n<p>As a slight variation of the above: use a nested field name and a temporal\nconstraint of the field with name <code>ts</code>:</p>\n<pre><code>where id.orig_h == 1.2.3.4 &#x26;&#x26; ts > 1 hour ago\n</code></pre>\n<p>Subnets are first-class values:</p>\n<pre><code>where 10.10.5.0/25\n</code></pre>\n<p>This expression unfolds to <code>:ip in 10.10.5.0/25 || :subnet == 10.10.5.0/25</code>. It\nmeans "select all events that contain a field of type <code>ip</code> in the subnet\n<code>10.10.5.0/25</code>, or a field of type <code>subnet</code> the exactly matches <code>10.10.5.0/25</code>".</p>\n<p>Expressions consist of predicates that can be connected with AND, OR, and NOT:</p>\n<pre><code>where 10.10.5.0/25 &#x26;&#x26; (orig_bytes > 1 Mi || duration > 30 min)\n</code></pre>',
326
+ docLink: "https://docs.tenzir.com/operators/transformations/where",
327
+ },
328
+ {
329
+ label: "write",
330
+ type: "keyword",
331
+ detail: "The write operator converts events into raw bytes.",
332
+ processedHTML:
333
+ '<h2>Synopsis</h2>\n<pre><code>write &#x3C;format>\n</code></pre>\n<h2>Description</h2>\n<p>The <code>write</code> operator prints events and outputs the formatted result as raw\nbytes.</p>\n<h3><code>&#x3C;format></code></h3>\n<p>The <a href="../../formats.md">format</a> used to convert events into raw bytes.</p>\n<p>Some formats have format-specific options. Please refer to the documentation of\nthe individual formats for more information.</p>\n<h2>Examples</h2>\n<p>Convert events into JSON:</p>\n<pre><code>write json\n</code></pre>\n<p>Convert events into CSV:</p>\n<pre><code>write csv\n</code></pre>',
334
+ docLink: "https://docs.tenzir.com/operators/transformations/write",
335
+ },
336
+ ];
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@tenzir/codemirror-lang-tql",
3
+ "repository": {
4
+ "type": "git",
5
+ "url": "git+https://github.com/tenzir/codemirror-lang-tql.git"
6
+ },
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
10
+ "version": "0.3.2",
11
+ "description": "Tenzir Query Language (TQL) support for CodeMirror",
12
+ "scripts": {
13
+ "build": "lezer-generator src/syntax.grammar -o src/parser && rollup -c",
14
+ "build-debug": "lezer-generator src/syntax.grammar --names -o src/parser && rollup -c",
15
+ "test": "mocha test/test.js"
16
+ },
17
+ "type": "module",
18
+ "main": "dist/index.cjs",
19
+ "module": "dist/index.js",
20
+ "exports": {
21
+ "import": "./dist/index.js",
22
+ "require": "./dist/index.cjs"
23
+ },
24
+ "types": "dist/index.d.ts",
25
+ "sideEffects": false,
26
+ "dependencies": {
27
+ "@codemirror/autocomplete": "^6.6.0",
28
+ "@codemirror/language": "^6.0.0",
29
+ "@lezer/highlight": "^1.1.6",
30
+ "@lezer/lr": "^1.3.0",
31
+ "hastscript": "^8.0.0",
32
+ "unist-util-visit": "^5.0.0"
33
+ },
34
+ "devDependencies": {
35
+ "@lezer/generator": "^1.3.0",
36
+ "mocha": "^9.0.1",
37
+ "rollup": "^2.60.2",
38
+ "rollup-plugin-dts": "^4.0.1",
39
+ "rollup-plugin-ts": "^3.0.2",
40
+ "typescript": "^4.3.4"
41
+ },
42
+ "license": "MIT"
43
+ }