Skip to content

Commit 51816d8

Browse files
author
Ruben van Vreeland
committed
Add support for end, debug, es_debug and verbose mode
1 parent 2019166 commit 51816d8

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/controllers/process/index.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,26 @@ export default class ProcessController {
6565
startArguments.push('--start', config.get('start'));
6666
}
6767

68+
if (config.get('end') !== undefined && config.get('end') !== '') {
69+
logger.info('Setting ElastAlert query ending to time ' + config.get('end'));
70+
startArguments.push('--end', config.get('end'));
71+
}
72+
73+
if (config.get('debug') === true) {
74+
logger.info('Setting ElastAlert debug mode. This will increase the logging verboseness, change all alerts to DebugAlerter, which prints alerts and suppresses their normal action, and skips writing search and alert metadata back to Elasticsearch.');
75+
startArguments.push('--debug');
76+
}
77+
78+
if (config.get('verbose') === true) {
79+
logger.info('Setting ElastAlert verbose mode. This will increase the logging verboseness, which allows you to see information about the state of queries.');
80+
startArguments.push('--verbose');
81+
}
82+
83+
if (config.get('es_debug') === true) {
84+
logger.info('Setting ElastAlert es_debug mode. This will enable logging for all queries made to Elasticsearch.');
85+
startArguments.push('--es_debug');
86+
}
87+
6888
logger.info('Starting elastalert with arguments ' + (startArguments.join(' ') || '[none]'));
6989

7090
this._process = spawn('python', ['elastalert/elastalert.py'].concat(startArguments), {

0 commit comments

Comments
 (0)