You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metron.apache.org by nickwallen <gi...@git.apache.org> on 2018/07/06 14:38:58 UTC
[GitHub] metron pull request #1083: METRON-1643: Create a REGEX_ROUTING field transfo...
Github user nickwallen commented on a diff in the pull request:
https://github.com/apache/metron/pull/1083#discussion_r200672238
--- Diff: metron-platform/metron-parsers/README.md ---
@@ -337,6 +337,28 @@ The following config will rename the fields `old_field` and `different_old_field
]
}
```
+* `REGEX_SELECT` : This transformation lets users set an output field to one of a set of possibilities based on matching regexes. This transformation is useful when the number or conditions are large enough to make a stellar language match statement unwieldy.
+
+The following config will set the field `my_output` to one of the
+following, dependent upon the value of the `my_input` field:
+* `awesome` if `my_input` starts with `metron` or `mortron`
+* `boo` if `my_input` starts with `scary`
+```
+{
+...
+ "fieldTransformations" : [
+ {
+ "transformation" : "REGEX_SELECT"
+ , "input" : "my_input"
+ , "output" : "my_output"
+ , "config" : {
+ "awesome" : [ "^metron.*", "^mortron.*" ],
--- End diff --
A little nit. It makes it harder to grok the docs when you use non-sensical phrases like 'boo', 'scary', etc in the primary example. Is there an actual use case that we could show here instead?
---