You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pipeline/filters/lookup.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Lookup
2
2
3
-
The Lookup plugin looks up a key value from a record in a specified CSV file and, if a match is found, adds the corresponding value from the CSV as a new key-value pair to the record.
3
+
The Lookup plugin searches for a record key's value in a CSV file's first column and adds the matching row's second column value as a new key-value pair if found.
4
4
5
5
## Configuration parameters
6
6
@@ -9,7 +9,7 @@ The plugin supports the following configuration parameters:
9
9
| Key | Description | Default |
10
10
| :-- | :---------- | :------ |
11
11
|`data_source`| Path to the CSV file that the Lookup filter will use as a lookup table. This file must contain one column of keys and one column of values. See [Key Considerations](#key-considerations) for details. |_none_ (required) |
12
-
|`lookup_key`| Specifies the record key whose value to search for in the CSV file's first column. Supports [record accessor](../administration/configuring-fluent-bit/classic-mode/record-accessor) syntax for nested fields and array indexing (e.g., `$user['profile']['id']`, `$users[0]['id']`). |_none_ (required) |
12
+
|`lookup_key`| Specifies the record key whose value to search for in the CSV file's first column. Supports [record accessor](../administration/configuring-fluent-bit/classic-mode/record-accessor) syntax for nested fields and array indexing (for example, `$user['profile']['id']`, `$users[0]['id']`). |_none_ (required) |
13
13
|`result_key`| If a CSV entry whose value matches the value of `lookup_key` is found, specifies the name of the new key to add to the output record. This new key uses the corresponding value from the second column of the CSV file in the same row where `lookup_key` was found. If this key already exists in the record, it will be overwritten. |_none_ (required) |
14
14
|`ignore_case`| Specifies whether to ignore case when searching for `lookup_key`. If `true`, searches are case-insensitive. If `false`, searches are case-sensitive. Case normalization applies to both the lookup key from the record and the keys in the CSV file. |`false`|
15
15
|`skip_header_row`| If `true`, the filter skips the first row of the CSV file, treating it as a header. If `false`, the first row is processed as data. |`false`|
@@ -112,7 +112,7 @@ no-match-host,Should Not Appear
112
112
113
113
When the filter finds a match, it adds a new key with the name specified by `result_key` and a value from the second column of the CSV file of the row where `lookup_key` was found.
114
114
115
-
For the above configuration the following output can be expected (when matching case is ignored as `ignore_case` is set to true):
115
+
For the previous configuration the following output can be expected (when matching case is ignored as `ignore_case` is set to true):
@@ -144,9 +144,9 @@ Each metric includes a `name` label to identify the filter instance.
144
144
145
145
- The CSV is used to create an in-memory key value lookup table. Column 1 of the CSV is always used as key, while column 2 is assumed to be the value. All other columns in the CSV are ignored.
146
146
- CSV fields can be enclosed in double quotes (`"`). Lines with unmatched quotes are logged as warnings and skipped.
147
-
- Multiline values in CSV file are not currently supported.
147
+
- Multiline values in CSV file aren't currently supported.
148
148
- Duplicate keys (values in first column) in the CSV will use the last occurrence (hash table behavior)
149
149
- Leading and trailing whitespace is automatically trimmed from both keys and values.
150
-
- The `lookup_key` can be of various types: strings are used directly, integers and floats are converted to their string representation, booleans become "true" or "false", and null becomes "null". Records with array or object values for the lookup key are passed through unchanged.
150
+
- The `lookup_key` can be of various types: strings are used directly, integers and floats are converted to their string representation, booleans become `true` or `false`, and null becomes `null`. Records with array or object values for the lookup key are passed through unchanged.
151
151
- Records without the `lookup_key` field or with no matching CSV entry are passed through unchanged.
152
-
- This filter is currently intended for static datasets. CSV is loaded once when Fluent Bit starts and is not reloaded.
152
+
- This filter is currently intended for static datasets. CSV is loaded once when Fluent Bit starts and isn't reloaded.
0 commit comments