ASF GitHub Bot commented on METRON-424:

Github user cestella commented on the issue:

    I figured out what was going on with this PR and it's kinda interesting, so 
forgive the long-winded explanation.
    @ottobackwards is indeed right, it is not apparent why his PR about a 
FieldTransformation and Stellar Function would affect the `YafIntegrationTest`. 
 Unfortunately, it became apparent when it consistently failed on this PR in 
both travis and locally that something was happening.
    It turns out the problem is 
  The keen observer will notice in the global config we are ensuring that the 
`src_ip_addr` and `dst_ip_addr` are valid IP addresses for the integration 
tests.  This, of course, is a typo (that I made :P ).  The correct field names 
are `ip_src_addr` and `ip_dst_addr`.  
    Now, you may ask:
    * How has this ever worked?
    * Given that it did work before, why is it broken now?
    Well, for the first question, it was never correct in the integration 
tests, but since we did not exercise the situation where we send in invalid IP 
addresses.  Furthermore, the default behavior for fields which do not exist is 
to return `true` (probably wrong).
    For the second question, @ottobackwards has changed the default behavior 
for fields which do not resolve is to return `false` (almost assuredly right).
    For clarity to show how I go about debugging these problems, I'll be rather 
explicit in how I figured out what was happening:
    * In my git branch, I added @ottobackwards 's repo as a remote repo and 
checked out the branch:
      * `git remote add otto 
      * `git checkout otto/METRON-424`
      * `git branch METRON-424-debug`
      * `git checkout METRON-424-debug`
    * In Intellij, I ran the YafIntegrationTest to verify that it continued to 
    * I set breakpoints at the exit points of the `ParserBolt`:
      * [Line 
      * [Line 
      * [Line 
    * It became apparent that we were exiting because the message was not 
valid.  I then set breakpoints inside of @ottobackwards 's code and validated 
that it was doing the right thing, but the fields were coming in as `null`, 
which means the fields were not in the message.
    * I tracked the `global.json` down and looked at the field names and there 
the bug became apparent.
    I submitted a PR to your PR branch, @ottobackwards, so if you merge that 
in, the build *should* work (fingers crossed ;)

> Stellar fieldValidation "IP" does not support list values
> ---------------------------------------------------------
>                 Key: METRON-424
>                 URL: https://issues.apache.org/jira/browse/METRON-424
>             Project: Metron
>          Issue Type: Bug
>            Reporter: Neha Sinha
> Currently, stellar fieldValidation *IP* accepts only single string 
> value.However we need the ability to specify a list of values,say, we want to 
> validate ip_dst_addr to be of either IPV4 or IPV6 type. This feature needs to 
> be incorporated.
> Desired Behaviour :- User should be able to configure ip validation as below 
> :-
> GLOBAL Config: global
> {
>   "es.clustername": "metron",
>   "es.ip": "metron-test1-10.openstacklocal",
>   "es.port": "9300",
>   "es.date.format": "yyyy.MM.dd.HH",
>   "fieldValidations" : [
>               {
>                 "input" : [ "ip_dst_addr" ],
>                 "validation" : "IP",
>                 "config" : {
>                     "type" : ["IPV6","IPV4"]
>                            }
>               }
>                        ]
> }

This message was sent by Atlassian JIRA

Reply via email to