-
Notifications
You must be signed in to change notification settings - Fork 5
Fields
Anton Zelenin edited this page Jun 2, 2022
·
11 revisions
- Field configuration
- Field configuration
- Transformation functions
- List of transformation functions
- Lookup transformations
Field - is a general concept of an item that can be extracted from source data. Currently, fields are used in Observium and Topology integrations.
Example of field usage:
"dimension_configurations": {
"DESTINATION_STATE": {
"type": "variable",
"value_path": ["port_label", "port"],
"concat_by": "_",
"transformations": [
{
"type": "function",
"name": "substring",
"args": [0, 2]
},
{
"type": "lookup",
"name": "DEST_GROUP_CATEGORY",
"key": "ABBREVIATION",
"value": "STATE",
"compare_function": "contains",
"default": "other",
"strict": false
}
]
}
}
| Property | Required | Type | Description |
|---|---|---|---|
value_path |
yes | String | Array |
type |
no | String | Possible values are variable and constant. Default: variable
|
value |
no | String | A value that is used for a field if it's a constant field |
transformations |
yes | Array | An array of transformations to apply to the extracted value |
| Property | Required | Type | Description |
|---|---|---|---|
type |
yes | String | Possible values are function and lookup
|
name |
yes | String | A name of a transformation function to apply or a lookup to use |
| Property | Required | Type | Description |
|---|---|---|---|
type |
yes | String | Value function
|
name |
yes | String | A name of a transformation function to apply |
args |
no | Array | A list of arguments to pass to a function |
| Property | Required | Type | Description |
|---|---|---|---|
type |
yes | String | Value lookup
|
name |
yes | String | A name of a lookup to use |
key |
yes | String | A column name to match the transformed value |
value |
yes | String | A column name to take value from, when it's matched by a key |
compare_function |
no | String | Name of a function to use when searching for a key. Default - equals
|
default |
no | String | A value to be used if the original value wasn't found in the lookup |
strict |
no | Boolean |
true by default, when enabled the lookup will throw an exception if more than one value was found during lookup. When disabled, lookup results will be sorted and the first value will be used |
A function configuration must have a name field that contains a function name to be applied to a value and might contain the args field, which contains a list of arguments to be passed to a function. For example, to divide a value by 8 write:
{
"type": "function",
"name": "divide",
"args": [8]
}
to_upper() - Make a string uppercase. Example:
{
"type": "function",
"name": "to_upper"
}
regex_substring(pattern, repl) Extract a substring using a regex. Example, get the first group of the regex that matches everything after the dot:
{
"type": "function",
"name": "regex_substring",
"args": [".+\\.(.+)", "\\g<1>"]
}
divide(denominator: int|float) - divide a value. Example:
{
"type": "function",
"name": "divide",
"args": [8]
}
To learn about lookup transformations visit the data lookup wiki page
- Home
- CLI reference
- API
- Kubernetes setup using Helm
- Podman setup
- Creating pipelines
- Test sources
- Data formats (JSON, CSV, AVRO, LOG)
- How to parse logs with grok patterns
- How to store sensitive information
- Automated pipelines creation
- Filtering
- Transformation files
- Fields
- DVP Configuration
- Integrations
- Sending events to Anodot