[
https://issues.apache.org/jira/browse/METRON-1660?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16539094#comment-16539094
]
ASF GitHub Bot commented on METRON-1660:
----------------------------------------
GitHub user justinleet opened a pull request:
https://github.com/apache/metron/pull/1102
METRON-1660: On Solr, sorting by threat score fails
## Contributor Comments
Updated the metaalert schema to properly use a dynamic field for threat
triage scores, consistent with other schemas. The one caveat is that
metaalerts uses a Double (consistent with how it calculates scores under the
hood). This does not break sorting.
To test, spin up in full dev. Go to the alert UI. Sort by Score.
Now create a metaalert (select a couple groups, click the link icon on the
right of the group). Navigate back to the main page. The metaalert will
likely have the highest score (as it uses sum of child alerts). Sort by Score
again and make sure the sorting changes appropriately.
Sort Ascending:
<img width="1468" alt="screen shot 2018-07-10 at 1 19 16 pm"
src="https://user-images.githubusercontent.com/5077341/42526466-e197fb60-8443-11e8-80ec-2011adf1d34c.png">
Sort Descending:
<img width="1467" alt="screen shot 2018-07-10 at 1 19 23 pm"
src="https://user-images.githubusercontent.com/5077341/42526468-e2c095c4-8443-11e8-9c57-15deccca6337.png">
## Pull Request Checklist
Thank you for submitting a contribution to Apache Metron.
Please refer to our [Development
Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235)
for the complete guide to follow for contributions.
Please refer also to our [Build Verification
Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview)
for complete smoke testing guides.
In order to streamline the review of the contribution we ask you follow
these guidelines and ask you to double check the following:
### For all changes:
- [x] Is there a JIRA ticket associated with this PR? If not one needs to
be created at [Metron
Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel).
- [x] Does your PR title start with METRON-XXXX where XXXX is the JIRA
number you are trying to resolve? Pay particular attention to the hyphen "-"
character.
- [x] Has your PR been rebased against the latest commit within the target
branch (typically master)?
### For code changes:
- [x] Have you included steps to reproduce the behavior or problem that is
being changed or addressed?
- [x] Have you included steps or a guide to how the change may be verified
and tested manually?
- [x] Have you ensured that the full suite of tests and checks have been
executed in the root metron folder via:
```
mvn -q clean integration-test install &&
dev-utilities/build-utils/verify_licenses.sh
```
- [x] Have you written or updated unit tests and or integration tests to
verify your changes?
- [x] If adding new dependencies to the code, are these dependencies
licensed in a way that is compatible for inclusion under [ASF
2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [x] Have you verified the basic functionality of the build by building
and running locally with Vagrant full-dev environment or the equivalent?
### For documentation related changes:
- [x] Have you ensured that format looks appropriate for the output in
which it is rendered by building and verifying the site-book? If not then run
the following commands and the verify changes via
`site-book/target/site/index.html`:
```
cd site-book
mvn site
```
#### Note:
Please ensure that once the PR is submitted, you check travis-ci for build
issues and submit an update to your PR as soon as possible.
It is also recommended that [travis-ci](https://travis-ci.org) is set up
for your personal repository such that your branches are built there before
submitting a pull request.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/justinleet/metron metaalertTriageSchema
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/metron/pull/1102.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 #1102
----
commit f4a79fe2ea8feeff09b12109f17e88a060b665c6
Author: justinjleet <justinjleet@...>
Date: 2018-07-10T17:10:33Z
Altering metaalerts schema to properly handle threat triage score
commit 54c248dd747d4cd64ce69759bf5322de59fea7f9
Author: justinjleet <justinjleet@...>
Date: 2018-07-10T18:32:57Z
adding integration test for sorting against threat triage score
----
> On Solr, sorting by threat score fails
> --------------------------------------
>
> Key: METRON-1660
> URL: https://issues.apache.org/jira/browse/METRON-1660
> Project: Metron
> Issue Type: Bug
> Reporter: Justin Leet
> Assignee: Justin Leet
> Priority: Major
>
> * HCP 1.5.1.0 bld 16
> * 12-node Ubuntu 14.04 cluster on Openstack
> * Solr indexing server + Kerberized
> *Steps to Reproduce*
> 1. Ingest snort events
> 2. Create a metaalert using snort alerts
> 3. Sort by 'Score'
> Following error is seen in REST API:
> {code}
> {"responseCode":500,"message":"No live SolrServers available to handle this
> request:[http://nat-u14-jaks-metron-1.openstacklocal:8983/solr/metaalert_shard1_replica1,
>
> http://nat-u14-jaks-metron-1.openstacklocal:8983/solr/yaf_shard1_replica1]","fullMessage":"HttpSolrClient.RemoteSolrException:
> Error from server at
> http://nat-u14-jaks-metron-1.openstacklocal:8983/solr/metaalert_shard1_replica1:
> java.lang.Float cannot be cast to java.lang.String"}
> {code}
> Following exceptions are seen in solr.log
> {code}
> 2018-07-09 09:41:25,817 [qtp705265961-18] ERROR [c:metaalert s:shard1
> r:core_node1 x:metaalert_shard1_replica1]
> org.apache.solr.common.SolrException (SolrException.java:159) -
> null:java.lang.ClassCastException: java.lang.Float cannot be cast to
> java.lang.String
> at
> org.apache.solr.schema.FieldType.unmarshalStringSortValue(FieldType.java:1100)
> at org.apache.solr.schema.StrField.unmarshalSortValue(StrField.java:105)
> at
> org.apache.solr.handler.component.QueryComponent.unmarshalSortValues(QueryComponent.java:1251)
> at
> org.apache.solr.handler.component.QueryComponent.mergeIds(QueryComponent.java:1075)
> at
> org.apache.solr.handler.component.QueryComponent.handleRegularResponses(QueryComponent.java:775)
> at
> org.apache.solr.handler.component.QueryComponent.handleResponses(QueryComponent.java:754)
> at
> org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:429)
> at
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:173)
> at org.apache.solr.core.SolrCore.execute(SolrCore.java:2477)
> at org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:723)
> at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:529)
> at
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:361)
> at
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:305)
> at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1691)
> at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
> at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
> at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
> at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)
> at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
> at
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
> at
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
> at
> org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:335)
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
> at org.eclipse.jetty.server.Server.handle(Server.java:534)
> at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
> at
> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
> at
> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
> at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
> at
> org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
> at
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
> at
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
> at
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
> at java.lang.Thread.run(Thread.java:745)
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)