-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
threat intel monitor bug fixes #1317
threat intel monitor bug fixes #1317
Conversation
Signed-off-by: Surya Sashank Nistala <[email protected]>
…ry and verify grouped listener wiring Signed-off-by: Surya Sashank Nistala <[email protected]>
Signed-off-by: Surya Sashank Nistala <[email protected]>
5aca445
to
f8911b8
Compare
|
Signed-off-by: Surya Sashank Nistala <[email protected]>
@@ -281,6 +285,8 @@ public void testCreateThreatIntelMonitor() throws IOException { | |||
String doc = String.format("{\"ip\":\"%s\", \"ip1\":\"%s\"}", val, val); | |||
try { | |||
indexDoc(index, "" + i++, doc); | |||
indexDoc(index, "" + i++, String.format("{\"ip\":\"1.2.3.4\", \"ip1\":\"1.2.3.4\"}", val, val)); | |||
indexDoc(index, "" + i++, String.format("{\"random\":\"%s\", \"random1\":\"%s\"}", val, val)); | |||
} catch (IOException e) { | |||
fail(); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a test scenario that replicates the case where the index being queried doesn't have any docs and it correctly catches the all shards failed
and the No mapping found for [_seq_no] in order to sort on
exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Signed-off-by: Surya Sashank Nistala <[email protected]>
* handle exception arising from trying to search with sort on empty index Signed-off-by: Surya Sashank Nistala <[email protected]> * add setting to test max term count in threat intel ioc scan terms query and verify grouped listener wiring Signed-off-by: Surya Sashank Nistala <[email protected]> * remove unused variable Signed-off-by: Surya Sashank Nistala <[email protected]> * avoid grouped listener being initiated with size 0 Signed-off-by: Surya Sashank Nistala <[email protected]> * add verification that empty index scan is handled gracefully Signed-off-by: Surya Sashank Nistala <[email protected]> --------- Signed-off-by: Surya Sashank Nistala <[email protected]> (cherry picked from commit 39c29d4) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* handle exception arising from trying to search with sort on empty index Signed-off-by: Surya Sashank Nistala <[email protected]> * add setting to test max term count in threat intel ioc scan terms query and verify grouped listener wiring Signed-off-by: Surya Sashank Nistala <[email protected]> * remove unused variable Signed-off-by: Surya Sashank Nistala <[email protected]> * avoid grouped listener being initiated with size 0 Signed-off-by: Surya Sashank Nistala <[email protected]> * add verification that empty index scan is handled gracefully Signed-off-by: Surya Sashank Nistala <[email protected]> --------- Signed-off-by: Surya Sashank Nistala <[email protected]> (cherry picked from commit 39c29d4) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* handle exception arising from trying to search with sort on empty index Signed-off-by: Surya Sashank Nistala <[email protected]> * add setting to test max term count in threat intel ioc scan terms query and verify grouped listener wiring Signed-off-by: Surya Sashank Nistala <[email protected]> * remove unused variable Signed-off-by: Surya Sashank Nistala <[email protected]> * avoid grouped listener being initiated with size 0 Signed-off-by: Surya Sashank Nistala <[email protected]> * add verification that empty index scan is handled gracefully Signed-off-by: Surya Sashank Nistala <[email protected]> --------- Signed-off-by: Surya Sashank Nistala <[email protected]> (cherry picked from commit 39c29d4) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* handle exception arising from trying to search with sort on empty index Signed-off-by: Surya Sashank Nistala <[email protected]> * add setting to test max term count in threat intel ioc scan terms query and verify grouped listener wiring Signed-off-by: Surya Sashank Nistala <[email protected]> * remove unused variable Signed-off-by: Surya Sashank Nistala <[email protected]> * avoid grouped listener being initiated with size 0 Signed-off-by: Surya Sashank Nistala <[email protected]> * add verification that empty index scan is handled gracefully Signed-off-by: Surya Sashank Nistala <[email protected]> --------- Signed-off-by: Surya Sashank Nistala <[email protected]> (cherry picked from commit 39c29d4) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* handle exception arising from trying to search with sort on empty index * add setting to test max term count in threat intel ioc scan terms query and verify grouped listener wiring * remove unused variable * avoid grouped listener being initiated with size 0 * add verification that empty index scan is handled gracefully --------- (cherry picked from commit 39c29d4) Signed-off-by: Surya Sashank Nistala <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* handle exception arising from trying to search with sort on empty index * add setting to test max term count in threat intel ioc scan terms query and verify grouped listener wiring * remove unused variable * avoid grouped listener being initiated with size 0 * add verification that empty index scan is handled gracefully --------- (cherry picked from commit 39c29d4) Signed-off-by: Surya Sashank Nistala <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* handle exception arising from trying to search with sort on empty index * add setting to test max term count in threat intel ioc scan terms query and verify grouped listener wiring * remove unused variable * avoid grouped listener being initiated with size 0 * add verification that empty index scan is handled gracefully --------- (cherry picked from commit 39c29d4) Signed-off-by: Surya Sashank Nistala <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
handle exception arising from trying to search with sort on empty index: Sorting by
_seq_no
field fails on empty index as mapping isn't created yet. This failure is expected and needs to be handled to return empty list instead of throwing exception and calling it a monitor failureadd setting to test max term count in threat intel ioc scan terms query and verify grouped listener wiring:
Use grouped listener to execute parallel calls instead of submitting calls with same listener
Index out of bounds exception as wrong listener is used.
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
#1319
Check List
--signoff
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.