Как запустить сервер Elastalert при использовании Kibana-плагина - PullRequest
1 голос
/ 29 марта 2019

Я использую плагин Kibana с сервером Elastalert от BitSensor. Я следую всем инструкциям в документе, но при запуске сервера Elastalert появляется ошибка

dat@dat-VirtualBox:~/Downloads/kibana-oss-6.4.2-linux-x86_64/elastalert$ npm start

> @bitsensor/elastalert@1.0.0 start /home/dat/Downloads/kibana-oss-6.4.2-linux-x86_64/elastalert
> sh ./scripts/start.sh

08:56:09.102Z  INFO elastalert-server: Config:  No config.dev.json file was found in /home/dat/Downloads/kibana-oss-6.4.2-linux-x86_64/elastalert/config/config.dev.json.
08:56:09.108Z  INFO elastalert-server: Config:  Proceeding to look for normal config file.
08:56:09.108Z  INFO elastalert-server: Config:  A config file was found in /home/dat/Downloads/kibana-oss-6.4.2-linux-x86_64/elastalert/config/config.json. Using that config.
08:56:09.115Z  INFO elastalert-server: Router:  Listening for GET request on /.
08:56:09.116Z  INFO elastalert-server: Router:  Listening for GET request on /status.
08:56:09.116Z  INFO elastalert-server: Router:  Listening for GET request on /status/control/:action.
08:56:09.116Z  INFO elastalert-server: Router:  Listening for GET request on /status/errors.
08:56:09.116Z  INFO elastalert-server: Router:  Listening for GET request on /rules.
08:56:09.119Z  INFO elastalert-server: Router:  Listening for GET request on /rules/:id.
08:56:09.119Z  INFO elastalert-server: Router:  Listening for POST request on /rules/:id.
08:56:09.119Z  INFO elastalert-server: Router:  Listening for DELETE request on /rules/:id.
08:56:09.120Z  INFO elastalert-server: Router:  Listening for GET request on /templates.
08:56:09.120Z  INFO elastalert-server: Router:  Listening for GET request on /templates/:id.
08:56:09.120Z  INFO elastalert-server: Router:  Listening for POST request on /templates/:id.
08:56:09.121Z  INFO elastalert-server: Router:  Listening for DELETE request on /templates/:id.
08:56:09.121Z  INFO elastalert-server: Router:  Listening for POST request on /test.
08:56:09.121Z  INFO elastalert-server: Router:  Listening for GET request on /config.
08:56:09.121Z  INFO elastalert-server: Router:  Listening for POST request on /config.
08:56:09.121Z  INFO elastalert-server: Router:  Listening for POST request on /download.
08:56:09.121Z  INFO elastalert-server: Router:  Listening for GET request on /metadata/:type.
08:56:09.122Z  INFO elastalert-server: Router:  Listening for GET request on /mapping/:index.
08:56:09.131Z  INFO elastalert-server: ProcessController:  Starting ElastAlert
08:56:09.131Z  INFO elastalert-server: ProcessController:  Creating index
08:56:09.163Z ERROR elastalert-server:
    Server:  Starting server failed with error: TypeError: Cannot read property 'toString' of null
        at ProcessController.start (/home/dat/Downloads/kibana-oss-6.4.2-linux-x86_64/elastalert/src/controllers/process/index.js:46:28)
        at /home/dat/Downloads/kibana-oss-6.4.2-linux-x86_64/elastalert/src/elastalert_server.js:71:33
        at /home/dat/Downloads/kibana-oss-6.4.2-linux-x86_64/elastalert/src/common/config/server_config.js:60:9
        at Array.forEach (<anonymous>)
        at /home/dat/Downloads/kibana-oss-6.4.2-linux-x86_64/elastalert/src/common/config/server_config.js:59:22
        at <anonymous>
08:56:09.165Z  INFO elastalert-server: Server:  Stopping server
08:56:09.166Z  INFO elastalert-server: ProcessController:  ElastAlert is not running
08:56:09.167Z  INFO elastalert-server: Server:  Server stopped. Bye!

Когда я проверяю index.js: 46: 28,Я думаю, что есть проблема с созданием индекса, но я не знаю, как ее решить. У кого-то есть идея, чтобы это исправить Это мой файл index.js

// Create ElastAlert index if it doesn't exist yet
    logger.info('Creating index');
    var indexCreate = spawnSync('python', ['-m', 'elastalert.create_index', '--index', 'elastalert_status', '--old-index', ''], {
      cwd: this._elastalertPath
    });

    // Redirect stdin/stderr to logger
    if (indexCreate.stdout.toString() !== '') {  ###### error in here
      logger.info(indexCreate.stdout.toString());
    }
    if (indexCreate.stderr.toString() !== '') {
      logger.error(indexCreate.stderr.toString());
    }

...