-
Notifications
You must be signed in to change notification settings - Fork 2k
chore(deps, internal docs): Add usage method to VRL functions #24504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ mod test_util; | |
| mod vrl_util; | ||
|
|
||
| use dyn_clone::DynClone; | ||
| use indoc::indoc; | ||
| pub use tables::{TableRegistry, TableSearch}; | ||
| use vrl::{ | ||
| compiler::Function, | ||
|
|
@@ -97,3 +98,59 @@ pub fn vrl_functions() -> Vec<Box<dyn Function>> { | |
| Box::new(find_enrichment_table_records::FindEnrichmentTableRecords) as _, | ||
| ] | ||
| } | ||
|
|
||
| pub(crate) const ENRICHMENT_TABLE_EXPLAINER: &str = indoc! {r#" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A good first start. I'm thinking we can add something simpler like a few examples that people can follow (and also for LLMs to train on) that would be easier than trying to wade through the technical docs/specs
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is just copied over but I think a new page on just enrichment tables w/ simple examples is definitely not a bad idea |
||
| For `file` enrichment tables, this condition needs to be a VRL object in which | ||
| the key-value pairs indicate a field to search mapped to a value to search in that field. | ||
| This function returns the rows that match the provided condition(s). _All_ fields need to | ||
| match for rows to be returned; if any fields do not match, then no rows are returned. | ||
|
|
||
| There are currently three forms of search criteria: | ||
|
|
||
| 1. **Exact match search**. The given field must match the value exactly. Case sensitivity | ||
| can be specified using the `case_sensitive` argument. An exact match search can use an | ||
| index directly into the dataset, which should make this search fairly "cheap" from a | ||
| performance perspective. | ||
|
|
||
| 2. **Wildcard match search**. The given fields specified by the exact match search may also | ||
| be matched exactly to the value provided to the `wildcard` parameter. | ||
| A wildcard match search can also use an index directly into the dataset. | ||
|
|
||
| 3. **Date range search**. The given field must be greater than or equal to the `from` date | ||
| and/or less than or equal to the `to` date. A date range search involves | ||
| sequentially scanning through the rows that have been located using any exact match | ||
| criteria. This can be an expensive operation if there are many rows returned by any exact | ||
| match criteria. Therefore, use date ranges as the _only_ criteria when the enrichment | ||
| data set is very small. | ||
|
|
||
| For `geoip` and `mmdb` enrichment tables, this condition needs to be a VRL object with a single key-value pair | ||
| whose value needs to be a valid IP address. Example: `{"ip": .ip }`. If a return field is expected | ||
| and without a value, `null` is used. This table can return the following fields: | ||
|
|
||
| * ISP databases: | ||
| * `autonomous_system_number` | ||
| * `autonomous_system_organization` | ||
| * `isp` | ||
| * `organization` | ||
|
|
||
| * City databases: | ||
| * `city_name` | ||
| * `continent_code` | ||
| * `country_code` | ||
| * `country_name` | ||
| * `region_code` | ||
| * `region_name` | ||
| * `metro_code` | ||
| * `latitude` | ||
| * `longitude` | ||
| * `postal_code` | ||
| * `timezone` | ||
|
|
||
| * Connection-Type databases: | ||
| * `connection_type` | ||
|
|
||
| To use this function, you need to update your configuration to | ||
| include an | ||
| [`enrichment_tables`](/docs/reference/configuration/global-options/#enrichment_tables) | ||
| parameter. | ||
| "#}; | ||
Uh oh!
There was an error while loading. Please reload this page.