Skip to content
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

EQL: Change result_position default value from head to tail #66387

Merged
merged 2 commits into from
Dec 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class EqlSearchRequest implements Validatable, ToXContentObject {
private QueryBuilder filter = null;
private String timestampField = "@timestamp";
private String eventCategoryField = "event.category";
private String resultPosition = "head";
private String resultPosition = "tail";

private int size = 10;
private int fetchSize = 1000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public void testEqlRestUsage() throws IOException {
DataLoader.loadDatasetIntoEs(highLevelClient(), this::createParser);
}

String defaultPipe = "pipe_tail";
//
// random event queries
//
Expand All @@ -141,7 +142,7 @@ public void testEqlRestUsage() throws IOException {
runEql("sequence [process where serial_event_id == 1] [process where serial_event_id == 2]");
}
responseAsMap = getStats();
metricsToCheck = Set.of("sequence", "sequence_queries_two", "pipe_head");
metricsToCheck = Set.of("sequence", "sequence_queries_two", defaultPipe);
assertFeaturesMetrics(randomSequenceExecutions, responseAsMap, metricsToCheck);
assertFeaturesMetricsExcept(responseAsMap, metricsToCheck);
assertAllQueryMetrics(allTotalQueries, responseAsMap);
Expand Down Expand Up @@ -194,7 +195,7 @@ public void testEqlRestUsage() throws IOException {
" [process where opcode == 2] by user");
}
responseAsMap = getStats();
metricsToCheck = Set.of("sequence", "sequence_queries_three", "pipe_head", "join_keys_one", "sequence_maxspan");
metricsToCheck = Set.of("sequence", "sequence_queries_three", "join_keys_one", "sequence_maxspan", defaultPipe);
assertFeaturesMetrics(randomThreeQueriesSequences, responseAsMap, metricsToCheck);
assertFeaturesMetricsExcept(responseAsMap, metricsToCheck);
assertAllQueryMetrics(allTotalQueries, responseAsMap);
Expand Down Expand Up @@ -230,7 +231,7 @@ public void testEqlRestUsage() throws IOException {
" [process where opcode == 1]");
}
responseAsMap = getStats();
metricsToCheck = Set.of("sequence", "sequence_queries_two", "pipe_head", "join_keys_four");
metricsToCheck = Set.of("sequence", "sequence_queries_two", "join_keys_four", defaultPipe);
assertFeaturesMetrics(randomFourJoinKeysExecutions, responseAsMap, metricsToCheck);
assertFeaturesMetricsExcept(responseAsMap, metricsToCheck);
assertAllQueryMetrics(allTotalQueries, responseAsMap);
Expand All @@ -246,7 +247,7 @@ public void testEqlRestUsage() throws IOException {
" [process where opcode == 1]");
}
responseAsMap = getStats();
metricsToCheck = Set.of("sequence", "sequence_queries_two", "pipe_head", "join_keys_five_or_more");
metricsToCheck = Set.of("sequence", "sequence_queries_two", "join_keys_five_or_more", defaultPipe);
assertFeaturesMetrics(randomFiveJoinKeysExecutions, responseAsMap, metricsToCheck);
assertFeaturesMetricsExcept(responseAsMap, metricsToCheck);
assertAllQueryMetrics(allTotalQueries, responseAsMap);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class EqlSearchRequest extends ActionRequest implements IndicesRequest.Re
private int size = RequestDefaults.SIZE;
private int fetchSize = RequestDefaults.FETCH_SIZE;
private String query;
private String resultPosition = "head";
private String resultPosition = "tail";

// Async settings
private TimeValue waitForCompletionTimeout = null;
Expand Down