Skip to content

Commit 1da9005

Browse files
maycmleecswattjszwedko
authored
chore(external docs): First batch of editorial edits for the Functions doc (vectordotdev#18780)
* make edits * more edits * apply suggestions * Apply suggestions from code review Co-authored-by: cecilia saixue watt <[email protected]> * cue fmt Signed-off-by: Jesse Szwedko <[email protected]> --------- Signed-off-by: Jesse Szwedko <[email protected]> Co-authored-by: cecilia saixue watt <[email protected]> Co-authored-by: Jesse Szwedko <[email protected]>
1 parent 0568d7a commit 1da9005

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+171
-179
lines changed

website/cue/reference/remap/functions.cue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ remap: {
5959

6060
// Reusable text
6161
_enrichment_table_explainer: """
62-
For `file` enrichment tables this condition needs to be a VRL object in which
62+
For `file` enrichment tables, this condition needs to be a VRL object in which
6363
the key-value pairs indicate a field to search mapped to a value to search in that field.
6464
This function returns the rows that match the provided condition(s). _All_ fields need to
65-
match for rows to be returned; if any fields don't match, no rows are returned.
65+
match for rows to be returned; if any fields do not match, then no rows are returned.
6666
6767
There are currently two forms of search criteria:
6868
@@ -72,15 +72,15 @@ remap: {
7272
performance perspective.
7373
7474
2. **Date range search**. The given field must be greater than or equal to the `from` date
75-
and less than or equal to the `to` date. Note that a date range search involves
76-
sequentially scanning through the rows that have been located via any exact match
75+
and less than or equal to the `to` date. A date range search involves
76+
sequentially scanning through the rows that have been located using any exact match
7777
criteria. This can be an expensive operation if there are many rows returned by any exact
78-
match criteria. We recommend using date ranges as the _only_ criteria when the enrichment
78+
match criteria. Therefore, use date ranges as the _only_ criteria when the enrichment
7979
data set is very small.
8080
81-
For `geoip` enrichment tables this condition needs to be a VRL object with a single key-value pair
81+
For `geoip` enrichment tables, this condition needs to be a VRL object with a single key-value pair
8282
whose value needs to be a valid IP address. Example: `{"ip": .ip }`. If a return field is expected
83-
and without a value, `null` will be used. This table can return following fields:
83+
and without a value, `null` is used. This table can return the following fields:
8484
8585
* ISP databases:
8686
* `autonomous_system_number`

website/cue/reference/remap/functions/append.cue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ remap: functions: append: {
99
arguments: [
1010
{
1111
name: "value"
12-
description: "The initial array"
12+
description: "The initial array."
1313
required: true
1414
type: ["array"]
1515
},
1616
{
1717
name: "items"
18-
description: "The items to append"
18+
description: "The items to append."
1919
required: true
2020
type: ["array"]
2121
},

website/cue/reference/remap/functions/assert.cue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ remap: functions: assert: {
2626
description: """
2727
An optional custom error message. If the equality assertion fails, `message` is
2828
appended to the default message prefix. See the [examples](#assert-examples) below
29-
for a sample fully formed log message.
29+
for a fully formed log message sample.
3030
"""
3131
required: false
3232
type: ["string"]
3333
},
3434
]
3535
internal_failure_reasons: [
36-
"`condition` evaluates to `false`",
36+
"`condition` evaluates to `false`.",
3737
]
3838
return: types: ["null"]
3939

website/cue/reference/remap/functions/assert_eq.cue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ remap: functions: assert_eq: {
55

66
description: """
77
Asserts that two expressions, `left` and `right`, have the same value. The program is
8-
aborted with the `message` if they are unequal.
8+
aborted with `message` if they do not have the same value.
99
"""
1010

1111
notices: [
@@ -34,7 +34,7 @@ remap: functions: assert_eq: {
3434
description: """
3535
An optional custom error message. If the equality assertion fails, `message` is
3636
appended to the default message prefix. See the [examples](#assert_eq-examples)
37-
below for a sample fully formed log message.
37+
below for a fully formed log message sample.
3838
"""
3939
required: false
4040
type: ["string"]

website/cue/reference/remap/functions/chunks.cue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package metadata
33
remap: functions: chunks: {
44
category: "Array"
55
description: """
6-
Chunks `value` into slices of length `chunk_size` bytes
6+
Chunks `value` into slices of length `chunk_size` bytes.
77
"""
88

99
arguments: [
@@ -21,8 +21,8 @@ remap: functions: chunks: {
2121
},
2222
]
2323
internal_failure_reasons: [
24-
"`chunk_size` must be at least 1 byte",
25-
"`chunk_size` is too large",
24+
"`chunk_size` must be at least 1 byte.",
25+
"`chunk_size` is too large.",
2626
]
2727
return: {
2828
types: ["array"]

website/cue/reference/remap/functions/compact.cue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package metadata
33
remap: functions: compact: {
44
category: "Enumerate"
55
description: """
6-
Compacts the `value` by removing "empty" values, where emptiness is defined using the
6+
Compacts the `value` by removing empty values, where empty values are defined using the
77
available parameters.
88
"""
99

website/cue/reference/remap/functions/decrypt.cue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ remap: functions: decrypt: {
3333
arguments: [
3434
{
3535
name: "ciphertext"
36-
description: "The string to decrypt. The should be raw bytes (not encoded)."
36+
description: "The string in raw bytes (not encoded) to decrypt."
3737
required: true
3838
type: ["string"]
3939
},
@@ -45,14 +45,14 @@ remap: functions: decrypt: {
4545
},
4646
{
4747
name: "key"
48-
description: "The key for decryption. The should be raw bytes of the key (not encoded). The length must match the algorithm requested."
48+
description: "The key in raw bytes (not encoded) for decryption. The length must match the algorithm requested."
4949
required: true
5050
type: ["string"]
5151
},
5252
{
5353
name: "iv"
5454
description: #"""
55-
The IV for decryption. The should be raw bytes of the IV (not encoded). The length must match the algorithm requested.
55+
The IV in raw bytes (not encoded) for decryption. The length must match the algorithm requested.
5656
A new IV should be generated for every message. You can use `random_bytes` to generate a cryptographically secure random value.
5757
The value should match the one used during encryption.
5858
"""#
@@ -61,9 +61,9 @@ remap: functions: decrypt: {
6161
},
6262
]
6363
internal_failure_reasons: [
64-
"`algorithm` isn't a supported algorithm",
65-
"`key` length doesn't match the key size required for the algorithm specified",
66-
"`iv` length doesn't match the iv size required for the algorithm specified",
64+
"`algorithm` is not a supported algorithm.",
65+
"`key` length does not match the key size required for the algorithm specified.",
66+
"`iv` length does not match the `iv` size required for the algorithm specified.",
6767
]
6868
return: types: ["string"]
6969

website/cue/reference/remap/functions/encode_key_value.cue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package metadata
33
remap: functions: encode_key_value: {
44
category: "Codec"
55
description: """
6-
Encodes the `value` to in key/value format with customizable delimiters. Default delimiters match
6+
Encodes the `value` into key-value format with customizable delimiters. Default delimiters match
77
the [logfmt](\(urls.logfmt)) format.
88
"""
99
notices: [
@@ -21,7 +21,7 @@ remap: functions: encode_key_value: {
2121
},
2222
{
2323
name: "fields_ordering"
24-
description: "The ordering of fields to preserve. Any fields not in this list will appear unordered, after any ordered fields."
24+
description: "The ordering of fields to preserve. Any fields not in this list are listed unordered, after all ordered fields."
2525
required: false
2626
type: ["array"]
2727
},
@@ -34,21 +34,21 @@ remap: functions: encode_key_value: {
3434
},
3535
{
3636
name: "field_delimiter"
37-
description: "The string that separates each key/value pair."
37+
description: "The string that separates each key-value pair."
3838
required: false
3939
default: " "
4040
type: ["string"]
4141
},
4242
{
4343
name: "flatten_boolean"
44-
description: "Whether to encode key/value with a boolean value as a standalone key if `true` and nothing if `false`."
44+
description: "Whether to encode key-value with a boolean value as a standalone key if `true` and nothing if `false`."
4545
required: false
4646
type: ["boolean"]
4747
default: false
4848
},
4949
]
5050
internal_failure_reasons: [
51-
"`fields_ordering` contains a non-string element",
51+
"`fields_ordering` contains a non-string element.",
5252
]
5353
return: types: ["string"]
5454

website/cue/reference/remap/functions/encode_logfmt.cue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ remap: functions: encode_logfmt: {
1616
},
1717
{
1818
name: "fields_ordering"
19-
description: "The ordering of fields to preserve. Any fields not in this list will appear unordered, after any ordered fields."
19+
description: "The ordering of fields to preserve. Any fields not in this list are listed unordered, after all ordered fields."
2020
required: false
2121
type: ["array"]
2222
},
2323
]
2424
internal_failure_reasons: [
25-
"`fields_ordering` contains a non-string element",
25+
"`fields_ordering` contains a non-string element.",
2626
]
2727
return: types: ["string"]
2828

website/cue/reference/remap/functions/encode_percent.cue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ remap: functions: encode_percent: {
1515
},
1616
{
1717
name: "ascii_set"
18-
description: "The ascii set to use when encoding the data."
18+
description: "The ASCII set to use when encoding the data."
1919
required: false
2020
type: ["string"]
2121
default: "NON_ALPHANUMERIC"

0 commit comments

Comments
 (0)