Fixed the openDistro babel error (#2250)

* Fixed the openDistro babel error

* Update package.json

Co-authored-by: Juanca Rodríguez <juanca.romo9@gmail.com>
This commit is contained in:
Jose Sanchez Robles 2020-06-08 09:10:02 +02:00 committed by GitHub
parent 63ec227a58
commit ad421a3050
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 9 deletions

View File

@ -2,6 +2,12 @@
All notable changes to the Wazuh app project will be documented in this file.
## Wazuh v3.13.0 - Kibana v7.6.1 - Revision 857
### Added
- Fixed error: only one instance of babel-polyfill is allowed [#2236](https://github.com/wazuh/wazuh-kibana-app/issues/2236)
## Wazuh v3.11.4 - Kibana v7.6.1 - Revision 858

View File

@ -4,7 +4,7 @@
"revision": "0870",
"code": "0870-0",
"kibana": {
"version": "7.7.0"
"version": "7.7.1"
},
"description": "Wazuh app",
"main": "index.js",
@ -42,11 +42,10 @@
"dependencies": {
"angular-animate": "1.7.8",
"angular-chart.js": "1.1.1",
"d3": "^5.12.0",
"angular-cookies": "1.6.5",
"angular-material": "1.1.18",
"axios": "^0.19.0",
"babel-polyfill": "^6.13.0",
"d3": "^5.12.0",
"install": "^0.10.1",
"js2xmlparser": "^3.0.0",
"json2csv": "^4.1.2",
@ -55,14 +54,15 @@
"pdfmake": "^0.1.37",
"pug-loader": "^2.4.0",
"querystring-browser": "1.0.4",
"react-redux": "^7.1.1",
"react-codemirror": "^1.0.0",
"react-redux": "^7.1.1",
"read-last-lines": "^1.7.2",
"redux": "^4.0.4",
"simple-tail": "^1.1.0",
"timsort": "^0.3.0",
"winston": "3.0.0"
},
"devDependencies": {
"@elastic/plugin-helpers": "^7.1.8",
"babel-eslint": "^8.2.6",
"chai": "^4.1.2",
"eslint": "^5.10.0",

View File

@ -13,7 +13,7 @@
// Require some libraries
import { ErrorResponse } from './error-response';
import { getConfiguration } from '../lib/get-configuration';
import simpleTail from 'simple-tail';
import { read } from 'read-last-lines';
import path from 'path';
import { UpdateConfigurationFile } from '../lib/update-configuration';
const updateConfigurationFile = new UpdateConfigurationFile();
@ -71,14 +71,15 @@ export class WazuhUtilsCtrl {
*/
async getAppLogs(req, reply) {
try {
const lastLogs = await simpleTail(
const lastLogs = await read(
path.join(__dirname, '../../../../optimize/wazuh/logs/wazuhapp.log'),
50
);
return lastLogs && Array.isArray(lastLogs)
const spliterLog = lastLogs.split('\n');
return spliterLog && Array.isArray(spliterLog)
? {
error: 0,
lastLogs: lastLogs.filter(
lastLogs: spliterLog.filter(
item => typeof item === 'string' && item.length
)
}