From 466bf8bdecababe7d41b8c89e8fd9fc0ce1431d9 Mon Sep 17 00:00:00 2001 From: John Susek Date: Wed, 14 Nov 2018 13:56:51 -0600 Subject: [PATCH 1/4] Update UPGRADING.md instructions. Show time labels along x-axis of chart. Fix issue with 'field changes' rule when used with a timeframe. Fix issue with thresholds not updating. --- MAINTENANCE.md | 4 +++- UPGRADING.md | 2 +- src/components/DateTime.vue | 17 ++--------------- src/lib/chartOptions.js | 8 +++++++- src/lib/parseDate.js | 17 +++++++++++++++++ src/store/config/index.js | 1 + 6 files changed, 31 insertions(+), 18 deletions(-) create mode 100644 src/lib/parseDate.js diff --git a/MAINTENANCE.md b/MAINTENANCE.md index 4a8a4ad2..d60365e3 100644 --- a/MAINTENANCE.md +++ b/MAINTENANCE.md @@ -14,7 +14,9 @@ Run `npm update` to install latest versions of packages per package.json. ## Elastalert (if neccessary) - Stash all changes in elastalert project -- Create docker image + push to servercentral/elastalert +- `make build v=master` +- `docker tag id servercentral/elastalert` +- `docker push servercentral/elastalert` ## Praeco diff --git a/UPGRADING.md b/UPGRADING.md index 88259064..cdea2727 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -3,7 +3,7 @@ To upgrade to the newest release of praeco, run the following commands: - `docker pull servercentral/praeco && docker pull servercentral/elastalert` -- `docker-compose down && docker-compose up` +- `docker-compose up --force-recreate --build && docker image prune -f` Some version upgrades require further configuration. Version specific upgrade instructions are below. diff --git a/src/components/DateTime.vue b/src/components/DateTime.vue index cd01e045..4aef23b9 100644 --- a/src/components/DateTime.vue +++ b/src/components/DateTime.vue @@ -10,7 +10,7 @@ @@ -118,7 +163,11 @@ export default { display: none; } -.el-row.empty .vue-query-builder > .vqb-group > .vqb-group-body > .rule-actions { +.el-row.empty + .vue-query-builder + > .vqb-group + > .vqb-group-body + > .rule-actions { position: static; } @@ -135,4 +184,10 @@ export default { .el-form { margin-top: -2ex; } + +.el-tabs .el-input { + font-size: 16px; + font-weight: bold; + font-family: monospace; +} diff --git a/src/components/config/alert/ConfigAlertSubjectBody.vue b/src/components/config/alert/ConfigAlertSubjectBody.vue index 5135ea92..446a8319 100644 --- a/src/components/config/alert/ConfigAlertSubjectBody.vue +++ b/src/components/config/alert/ConfigAlertSubjectBody.vue @@ -153,7 +153,7 @@ export default { }, methods: { - sampleDebounced: debounce(() => { + sampleDebounced: debounce(function() { this.$store.dispatch('config/sample'); }, 750) } diff --git a/src/store/config/index.js b/src/store/config/index.js index 25d6aa3b..bbba5d55 100644 --- a/src/store/config/index.js +++ b/src/store/config/index.js @@ -95,6 +95,10 @@ export default { if (config.__praeco_query_builder && config.__praeco_query_builder.query) { commit('query/UPDATE_TREE', config.__praeco_query_builder.query); + commit('query/UPDATE_TYPE', 'tree'); + } else { + commit('query/UPDATE_MANUAL', config.filter[0].query.query_string.query); + commit('query/UPDATE_TYPE', 'manual'); } if (config.timestamp_field) { @@ -560,7 +564,11 @@ export default { config.__praeco_full_path = state.settings.name; } - config.__praeco_query_builder = JSON.stringify({ query: state.query.tree }); + // if the user is using a manual query, then don't save this to the config, + // so we know when loading it is manual + if (state.query.type === 'tree') { + config.__praeco_query_builder = JSON.stringify({ query: state.query.tree }); + } if (state.settings.name) { config.name = state.settings.name; diff --git a/src/store/config/query.js b/src/store/config/query.js index 08889be7..48485674 100644 --- a/src/store/config/query.js +++ b/src/store/config/query.js @@ -5,7 +5,9 @@ function initialState() { tree: { logicalOperator: 'all', children: [] - } + }, + manual: '', + type: 'tree' }; } @@ -25,11 +27,23 @@ export default { UPDATE_TREE(state, tree) { state.tree = tree; + }, + + UPDATE_MANUAL(state, manual) { + state.manual = manual; + }, + + UPDATE_TYPE(state, type) { + state.type = type; } }, getters: { queryString(state) { + if (state.type === 'manual') { + return state.manual; + } + return luceneSyntaxFromQueryBuilder(state.tree); } } diff --git a/src/store/configs.js b/src/store/configs.js index 5a5e22c4..ddca199a 100644 --- a/src/store/configs.js +++ b/src/store/configs.js @@ -201,6 +201,7 @@ export default { fullPath = ''; } else if (config.__praeco_full_path) { fullPath = config.__praeco_full_path; + delete config.__praeco_full_path; } else { fullPath = ''; } diff --git a/src/style/element.scss b/src/style/element.scss index ed983075..79047dd0 100644 --- a/src/style/element.scss +++ b/src/style/element.scss @@ -171,6 +171,10 @@ font-size: 20px; } +.el-dialog__headerbtn { + z-index: 9; +} + // // Menu // From cc9ba3b672a01defc807c149243c64f115622dd9 Mon Sep 17 00:00:00 2001 From: John Susek Date: Wed, 5 Dec 2018 16:31:14 -0600 Subject: [PATCH 4/4] Add loading indicator for event table --- config/elastalert.yaml | 2 ++ src/components/EventTable.vue | 43 +++++++++++++++++++-------- src/components/config/ConfigQuery.vue | 2 +- 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/config/elastalert.yaml b/config/elastalert.yaml index 4fc641cd..efc230f5 100644 --- a/config/elastalert.yaml +++ b/config/elastalert.yaml @@ -47,3 +47,5 @@ writeback_index: praeco_elastalert_status # sending the alert until this time period has elapsed alert_time_limit: days: 2 + +skip_invalid: True diff --git a/src/components/EventTable.vue b/src/components/EventTable.vue index 3bef8da2..9762c44e 100644 --- a/src/components/EventTable.vue +++ b/src/components/EventTable.vue @@ -1,6 +1,7 @@