Skip to content

Commit d9d5753

Browse files
committed
Add an example
1 parent a71ac87 commit d9d5753

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docs/reference/enrich-processor/append-processor.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ $$$append-options$$$
2525
| `on_failure` | no | - | Handle failures for the processor. See [Handling pipeline failures](docs-content://manage-data/ingest/transform-enrich/ingest-pipelines.md#handling-pipeline-failures). |
2626
| `tag` | no | - | Identifier for the processor. Useful for debugging and metrics. |
2727

28+
## Examples [append-processor-examples]
29+
30+
### Simple example [append-processor-simple-example]
31+
32+
Here is an that adds the string "production" as well as the values of the "app" and "owner" fields to the "tags" field:
33+
2834
```js
2935
{
3036
"append": {
@@ -34,3 +40,21 @@ $$$append-options$$$
3440
}
3541
```
3642

43+
### Example using `allow_duplicates` and `ignore_empty_values`
44+
45+
```{applies_to}
46+
stack: ga 9.2
47+
```
48+
49+
By using `allow_duplicates` and `ignore_empty_values`, it is possible to only append the `host.name` to the `related.hosts` if the `host.name` is not empty and if the value not already present in `related.hosts`:
50+
51+
```js
52+
{
53+
"append": {
54+
"field": "related.hosts",
55+
"copy_from": "host.name",
56+
"allow_duplicates": false,
57+
"ignore_empty_values": true
58+
}
59+
}
60+
```

0 commit comments

Comments
 (0)