Skip to content

Commit

Permalink
Perform more wordsmithing
Browse files Browse the repository at this point in the history
  • Loading branch information
mavam committed Apr 29, 2024
1 parent 42fd38b commit cb434c9
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 30 deletions.
28 changes: 13 additions & 15 deletions web/docs/operators/chart.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,45 +23,43 @@ The `chart` operator adds attributes to the schema of the input events,
that are used to guide rendering of the data as a chart.
The operator does no rendering itself.

The `fields` option value is either the name of a single field, or a
comma-separated list of multiple field names, e.g., `foo,bar,baz`.

### `-x|--x-axis <fields>` (`line`, `area`, and `bar` charts only)

Set the field used for the X-axis.
Sets the field used for the X-axis.

Values in this field must be strictly increasing
(sorted in ascending order, without duplicates)
when creating a `line` or `area` chart,
or unique when creating a `bar` chart.
Values in this field must be strictly increasing (sorted in ascending order,
without duplicates) when creating a `line` or `area` chart, or unique when
creating a `bar` chart.

Defaults to the first field in the schema.
Defaults to the first field in the schema.

### `-y|--y-axis <fields>` (`line`, `area`, and `bar` charts only)

Set the fields used for the Y-axis.
Can either be a single field, or a list of fields spelled with
a list syntax (`[field1, field2]`).
Sets the fields used for the Y-axis.

Defaults to every field but the first one.

### `position=<position>` (`line`, `area`, and `bar` charts only)

Control how the values are grouped when rendered as a chart.
Controls how the values are grouped when rendered as a chart.
Possible values are `grouped` and `stacked`.

Defaults to `grouped`.

### `--name <field>` (`pie` chart only)

Set the field used for the names of the segments.
Sets the field used for the names of the segments.

Values in this field must be unique.

Defaults to the first field in the schema.

### `--value <fields>` (`pie` chart only)

Set the fields used for the value of a segment.
Can either be a single field, or multiple fields delimited with commas
(`field1,field2`).
Sets the fields used for the value of a segment.

Defaults to every field but the first one.

Expand All @@ -73,7 +71,7 @@ Render most common `src_ip` values in `suricata.flow` events as a bar chart:
export
| where #schema == "suricata.flow"
| top src_ip
/* -x and -y are defaulted to `src_ip` and `count` */
/* -x and -y default to `src_ip` and `count` */
| chart bar
```

Expand Down
34 changes: 19 additions & 15 deletions web/versioned_docs/version-Tenzir v4.12/operators/chart.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,40 +23,44 @@ The `chart` operator adds attributes to the schema of the input events,
that are used to guide rendering of the data as a chart.
The operator does no rendering itself.

The `fields` option value is either the name of a single field, or a
comma-separated list of multiple field names, e.g., `foo,bar,baz`.

### `-x|--x-axis <fields>` (`line`, `area`, and `bar` charts only)

Set the field used for the X-axis. Defaults to the first field in the schema.
Sets the field used for the X-axis.

Values in this field must be strictly increasing (sorted in ascending order,
without duplicates) when creating a `line` or `area` chart, or unique when
creating a `bar` chart.

Values in this field must be strictly increasing
(sorted in ascending order, without duplicates)
when creating a `line` or `area` chart,
or unique when creating a `bar` chart.
Defaults to the first field in the schema.

### `-y|--y-axis <fields>` (`line`, `area`, and `bar` charts only)

Set the fields used for the Y-axis.
Can either be a single field, or multiple fields delimited with commas
(`field1,field2`).
Sets the fields used for the Y-axis.

Defaults to every field but the first one.

### `position=<position>` (`line`, `area`, and `bar` charts only)

Control how the values are grouped when rendered as a chart.
Controls how the values are grouped when rendered as a chart.
Possible values are `grouped` and `stacked`.

Defaults to `grouped`.

### `--name <field>` (`pie` chart only)

Set the field used for the names of the segments.
Defaults to the first field in the schema.
Sets the field used for the names of the segments.

Values in this field must be unique.

Defaults to the first field in the schema.

### `--value <fields>` (`pie` chart only)

Set the fields used for the value of a segment.
Can either be a single field, or multiple fields delimited with commas
(`field1,field2`).
Sets the fields used for the value of a segment.

Defaults to every field but the first one.

## Examples
Expand All @@ -67,7 +71,7 @@ Render most common `src_ip` values in `suricata.flow` events as a bar chart:
export
| where #schema == "suricata.flow"
| top src_ip
/* -x and -y are defaulted to `src_ip` and `count` */
/* -x and -y default to `src_ip` and `count` */
| chart bar
```

Expand Down

0 comments on commit cb434c9

Please sign in to comment.