[ 
https://issues.apache.org/jira/browse/METRON-1643?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16534925#comment-16534925
 ] 

ASF GitHub Bot commented on METRON-1643:
----------------------------------------

Github user cestella commented on a diff in the pull request:

    https://github.com/apache/metron/pull/1083#discussion_r200675612
  
    --- 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 --
    
    I changed the parsers docs to reflect the use-case that I wrote up for the 
next PR.  That should fold in well together and be a real use-case.  Thanks for 
the feedback.


> Create a REGEX_ROUTING field transformation
> -------------------------------------------
>
>                 Key: METRON-1643
>                 URL: https://issues.apache.org/jira/browse/METRON-1643
>             Project: Metron
>          Issue Type: Improvement
>            Reporter: Casey Stella
>            Priority: Major
>
> A relatively common pattern is to choose the value of a field based on if 
> another field matches a set of regexes.  This can be done via stellar with 
> match, but if the list of possible regexes are large, that can be unwieldy.  
> To ease that burden, we should have a REGEX_ROUTING field transformation.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to