You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@metron.apache.org by mmiklavc <gi...@git.apache.org> on 2016/10/06 17:13:15 UTC
[GitHub] incubator-metron pull request #296: METRON-439: Stellar : IS_EMPTY(host) thr...
GitHub user mmiklavc opened a pull request:
https://github.com/apache/incubator-metron/pull/296
METRON-439: Stellar : IS_EMPTY(host) throws exception
Fix Stellar IS_EMPTY validation to handle empty and null
Addresses https://issues.apache.org/jira/browse/METRON-439
Things have changed a bit since the original Jira was filed. Most notably, this error appears while dumping config from Zookeeper after it has already been loaded. The current functionality/validation would not have allowed the load to succeed in the first place. Even so, empty and null checks could be handled more gracefully. This PR changes IS_EMPTY to return true on null or empty string rather than throw an exception.
Added new unit tests and validated on quick-dev with multiple bro messages - normal host, empty host string, and null/non-existent host string.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/mmiklavc/incubator-metron METRON-439
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-metron/pull/296.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #296
----
commit bd6e1a5cc48962af36b131e189ffb461e836cd20
Author: Michael Miklavcic <mi...@gmail.com>
Date: 2016-10-06T17:09:14Z
METRON-439: Fix Stellar IS_EMPTY validation to handle empty and null
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-metron issue #296: METRON-439: Stellar : IS_EMPTY(host) throws exc...
Posted by mmiklavc <gi...@git.apache.org>.
Github user mmiklavc commented on the issue:
https://github.com/apache/incubator-metron/pull/296
@ottobackwards The Stellar validation currently runs by passing an empty member to the apply function. The original reason for the validation was to help keep bad configs from ending up in zookeeper. Now with the Stellar REPL, users should be able to more easily do their own client-side validations.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-metron issue #296: METRON-439: Stellar : IS_EMPTY(host) throws exc...
Posted by ottobackwards <gi...@git.apache.org>.
Github user ottobackwards commented on the issue:
https://github.com/apache/incubator-metron/pull/296
I'm working on making LENGTH work like IS_EMPTY. I can't get either one to work as both are failing validation. There is no StellarTest for IS_EMPTY ( I have added one to check if it is just my code that is failing ). Can you one and try it there an make sure it works all the way through the Stellar parse and variable resolve?
ParseException: Unable to parse IS_EMPTY(foo): Unable to execute: IS_EMPTY expects a collection or a string
This is when calling with
`String query = "IS_EMPTY(foo);
Asser.assertEquals(true,run(query,ImmutableMap.of("foo",""));
`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-metron issue #296: METRON-439: Stellar : IS_EMPTY(host) throws exc...
Posted by cestella <gi...@git.apache.org>.
Github user cestella commented on the issue:
https://github.com/apache/incubator-metron/pull/296
+1 by inspection
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-metron issue #296: METRON-439: Stellar : IS_EMPTY(host) throws exc...
Posted by ottobackwards <gi...@git.apache.org>.
Github user ottobackwards commented on the issue:
https://github.com/apache/incubator-metron/pull/296
OK, if I change my functions to not throw then it works. This doesn't seem right to me, but it may be something to do with why the tests are run that way.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-metron pull request #296: METRON-439: Stellar : IS_EMPTY(host) thr...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/incubator-metron/pull/296
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---