Skip to content

Commit

Permalink
Edit doc
Browse files Browse the repository at this point in the history
  • Loading branch information
george pogosyan committed Jul 2, 2024
1 parent 6858e96 commit 234f8d3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
8 changes: 7 additions & 1 deletion plugin/action/remove_fields/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ It removes the list of the event fields and keeps others.
### Config params
**`fields`** *`[]string`*

The list of the fields to remove. Nested fields supported.
The list of the fields to remove.
Nested fields supported: list subfield names separated with dot.
Example:
```
fields: ["a.b.c"]
{"a":{"b":{"c": 100}}} -> {"a":{"b":{}}}
```

<br>

Expand Down
10 changes: 8 additions & 2 deletions plugin/action/remove_fields/remove_fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ type Plugin struct {
type Config struct {
// > @3@4@5@6
// >
// > The list of the fields to remove. Nested fields supported.
// > The list of the fields to remove.
// > Nested fields supported: list subfield names separated with dot.
// > Example:
// > ```
// > fields: ["a.b.c"]
// > {"a":{"b":{"c": 100}}} -> {"a":{"b":{}}}
// > ```
Fields []string `json:"fields"` // *
}

Expand Down Expand Up @@ -72,7 +78,7 @@ func (p *Plugin) Start(config pipeline.AnyConfig, _ *pipeline.ActionPluginParams
}

if strings.HasPrefix(f1, f2) {
logger.Warnf("path '%s' included in '%s' path; remove nested path", f1, f2)
logger.Warnf("path '%s' included in path '%s'; remove nested path", f1, f2)
ok = false
break
}
Expand Down

0 comments on commit 234f8d3

Please sign in to comment.