Skip to content

Commit

Permalink
Remove restructure operator (#371)
Browse files Browse the repository at this point in the history
  • Loading branch information
djaglowski authored Mar 24, 2022
1 parent 08567da commit 03a140e
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 1,165 deletions.
1 change: 0 additions & 1 deletion docs/operators/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ General purpose:
- [move](/docs/operators/move.md)
- [recombine](/docs/operators/recombine.md)
- [remove](/docs/operators/remove.md)
- [restructure](/docs/operators/restructure.md)
- [retain](/docs/operators/retain.md)
- [router](/docs/operators/router.md)

Expand Down
220 changes: 0 additions & 220 deletions docs/operators/restructure.md

This file was deleted.

19 changes: 9 additions & 10 deletions docs/types/field.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,18 @@ If a field does not start with `resource`, `attributes`, or `body`, then `body`

## Examples

#### Using fields with the restructure operator.
#### Using fields with the add and remove operators.

Config:
```yaml
- type: restructure
ops:
- add:
field: "key3"
value: "value3"
- remove: "body.key2.nested_key1"
- add:
field: "attributes.my_attribute"
value: "my_attribute_value"
- type: add
field: key3
value: val3
- type: remove
field: body.key2.nested_key1
- type: add
field: attributes.my_attribute
value: my_attribute_value
```
<table>
Expand Down
2 changes: 1 addition & 1 deletion operator/transformer/remove/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (p *RemoveOperator) Process(ctx context.Context, entry *entry.Entry) error
return p.ProcessWith(ctx, entry, p.Transform)
}

// Transform will apply the restructure operations to an entry
// Transform will apply the remove operation to an entry
func (p *RemoveOperator) Transform(entry *entry.Entry) error {
if p.Field.allAttributes {
entry.Attributes = nil
Expand Down
Loading

0 comments on commit 03a140e

Please sign in to comment.