-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into port-copy-operator
- Loading branch information
Showing
10 changed files
with
1,141 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,181 @@ | ||
## `remove` operator | ||
|
||
The `remove` operator removes a field from a record. | ||
|
||
### Configuration Fields | ||
|
||
| Field | Default | Description | | ||
| --- | --- | --- | | ||
| `id` | `remove` | A unique identifier for the operator | | ||
| `output` | Next in pipeline | The connected operator(s) that will receive all outbound entries | | ||
| `field` | required | The [field](/docs/types/field.md) to remove. | ||
| `on_error` | `send` | The behavior of the operator if it encounters an error. See [on_error](/docs/types/on_error.md) | | ||
| `if` | | An [expression](/docs/types/expression.md) that, when set, will be evaluated to determine whether this operator should be used for the given entry. This allows you to do easy conditional parsing without branching logic with routers. | | ||
|
||
Example usage: | ||
|
||
<hr> | ||
|
||
Remove a value from the record | ||
```yaml | ||
- type: remove | ||
field: key1 | ||
``` | ||
<table> | ||
<tr><td> Input Entry </td> <td> Output Entry </td></tr> | ||
<tr> | ||
<td> | ||
```json | ||
{ | ||
"resource": { }, | ||
"labels": { }, | ||
"record": { | ||
"key1": "val1", | ||
} | ||
} | ||
``` | ||
|
||
</td> | ||
<td> | ||
|
||
```json | ||
{ | ||
"resource": { }, | ||
"labels": { }, | ||
"record": { } | ||
} | ||
``` | ||
|
||
</td> | ||
</tr> | ||
</table> | ||
|
||
<hr> | ||
|
||
Remove an object from the record | ||
```yaml | ||
- type: remove | ||
field: object | ||
``` | ||
<table> | ||
<tr><td> Input Entry </td> <td> Output Entry </td></tr> | ||
<tr> | ||
<td> | ||
```json | ||
{ | ||
"resource": { }, | ||
"labels": { }, | ||
"record": { | ||
"object": { | ||
"nestedkey": "nestedval" | ||
}, | ||
"key": "val" | ||
}, | ||
} | ||
``` | ||
|
||
</td> | ||
<td> | ||
|
||
```json | ||
{ | ||
"resource": { }, | ||
"labels": { }, | ||
"record": { | ||
"key": "val" | ||
} | ||
} | ||
``` | ||
|
||
</td> | ||
</tr> | ||
</table> | ||
|
||
<hr> | ||
|
||
Remove a value from labels | ||
```yaml | ||
- type: remove | ||
field: $labels.otherkey | ||
``` | ||
<table> | ||
<tr><td> Input Entry </td> <td> Output Entry </td></tr> | ||
<tr> | ||
<td> | ||
```json | ||
{ | ||
"resource": { }, | ||
"labels": { | ||
"otherkey": "val" | ||
}, | ||
"record": { | ||
"key": "val" | ||
}, | ||
} | ||
``` | ||
|
||
</td> | ||
<td> | ||
|
||
```json | ||
{ | ||
"resource": { }, | ||
"labels": { }, | ||
"record": { | ||
"key": "val" | ||
} | ||
} | ||
``` | ||
|
||
</td> | ||
</tr> | ||
</table> | ||
|
||
<hr> | ||
|
||
Remove a value from resource | ||
|
||
```yaml | ||
- type: remove | ||
field: $resource.otherkey | ||
``` | ||
<table> | ||
<tr><td> Input Entry </td> <td> Output Entry </td></tr> | ||
<tr> | ||
<td> | ||
```json | ||
{ | ||
"resource": { | ||
"otherkey": "val" | ||
}, | ||
"labels": { }, | ||
"record": { | ||
"key": "val" | ||
}, | ||
} | ||
``` | ||
|
||
</td> | ||
<td> | ||
|
||
```json | ||
{ | ||
"resource": { }, | ||
"labels": { }, | ||
"record": { | ||
"key": "val" | ||
} | ||
} | ||
``` | ||
|
||
</td> | ||
</tr> | ||
</table> |
Oops, something went wrong.