Skip to content

Commit ddfd8a5

Browse files
committed
Add maxResults option to control number of results returned from elastalert.
1 parent b473229 commit ddfd8a5

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/controllers/test/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ export default class TestController {
3737
processOptions.push('--formatted-output');
3838
}
3939

40+
if (options.maxResults > 0) {
41+
processOptions.push('--max-query-size');
42+
processOptions.push(options.maxResults);
43+
}
44+
4045
if (options.alert) {
4146
processOptions.push('--alert');
4247
}

src/handlers/test/post.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ const optionsSchema = Joi.object().keys({
99
testType: Joi.string().valid('all', 'schemaOnly', 'countOnly').default('all'),
1010
days: Joi.number().min(1).default(1),
1111
alert: Joi.boolean().default(false),
12-
format: Joi.string().default('')
12+
format: Joi.string().default(''),
13+
maxResults: Joi.number().default(0)
1314
}).default();
1415

1516
function analyzeRequest(request) {

0 commit comments

Comments
 (0)