-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Time Window Feature #301
Time Window Feature #301
Conversation
Thank you very much for this pull request! |
Due to the maintenance hibernation of the elastalert formula, we have recently made a bug fix or feature addition pull request for the active fork jertel/elastalert, so we haven't reviewed it yet. I'm sorry. When the work is settled, be sure to review it and merge it if there is no problem. |
Why are you erasing "config = {... config, ... getters.aggregation};"? |
@nsano-rururu
|
thank you for your answer. I overlooked it. |
Unit tests that give an error cannot be merged. Do you know the cause?
|
hey looks like nullish-coalescing-operator is yet to be supported: vuejs/vue#10386 |
I feel like I need to modify the results of the test code.
vi babel.config.js
[CORP\sano@a-ngft53r34ong praeco]$ npm install
up to date, audited 2072 packages in 3s
26 packages are looking for funding
run `npm fund` for details
6 low severity vulnerabilities
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.
[CORP\sano@a-ngft53r34ong praeco]$ npm run test:unit
> [email protected] test:unit
> vue-cli-service test:unit
Download the Vue Devtools extension for a better development experience:
https://github.com/vuejs/vue-devtools
You are running Vue in development mode.
Make sure to turn on production mode when deploying for production.
See more tips at https://vuejs.org/guide/deployment.html
WEBPACK Compiling...
[=========================] 98% (after emitting)
DONE Compiled successfully in 23687ms
[=========================] 100% (completed)
WEBPACK Compiled successfully in 23687ms
MOCHA Testing...
ConfigAlert
✓ renders the realert amount (1985ms)
✓ renders the realert unit (47ms)
✓ renders the right destination (181ms)
✓ renders the right subject (235ms)
✓ renders the right body (43ms)
✓ renders the right slack channel (62ms)
✓ renders the right slack user
✓ renders the right slack message color
ConfigCondition log
✓ renders the numEvents (580ms)
✓ renders the aboveOrBelow
✓ renders the WHEN count
✓ renders the OVER all documents
✓ renders the UNFILTERED
✓ renders the GROUPED OVER field
✓ renders the timeframe interval
✓ renders the timeframe amount
✓ renders the WITH OPTIONS useCountQuery
✓ renders the WITH OPTIONS docType
YAML parsing
1) renders the correct yaml
Errors log
✓ renders the rule
✓ renders the error
Queries log
✓ renders the query log correctly (413ms)
RuleView
✓ renders the rule
Silences log
✓ renders the silence log correctly (242ms)
alertText
✓ returns config-formatted alert text
✓ returns html-formatted alert text
luceneSyntaxBuilder
✓ returns correct query string given empty querybuilder tree
✓ returns correct query string given filled querybuilder tree
✓ returns correct query string given completely filled querybuilder tree
28 passing (5s)
1 failing
1) YAML parsing
renders the correct yaml:
AssertionError: expected '__praeco_full_path: test123\n__praeco_query_builder: \'{"query":{"logicalOperator":"all","children":[]}}\'\nalert:\n - slack\nalert_subject: this is a test subject\nalert_subject_args: []\nalert_text: this is a test body\nalert_text_args: []\nalert_text_type: alert_text_only\ndoc_type: syslog\nfilter:\n - query:\n query_string:\n query: \'@timestamp:*\'\nimport: BaseRule.config\nindex: hannibal-*\nis_enabled: false\nmatch_enhancements: []\nname: test123\nnum_events: 10000\nrealert:\n minutes: 5\nslack_channel_override: \'#elastalert-debugging\'\nslack_msg_color: danger\nslack_title_link: undefined/rules/test123\nslack_username_override: Praeco\nterms_size: 50\ntimeframe:\n minutes: 5\ntimestamp_field: \'@timestamp\'\ntimestamp_type: iso\ntype: frequency\nuse_count_query: true\nuse_strftime_index: false\n' to equal '__praeco_full_path: test123\n__praeco_query_builder: \'{"query":{"logicalOperator":"all","children":[]}}\'\nalert:\n - slack\nalert_subject: this is a test subject\nalert_subject_args: []\nalert_text: this is a test body\nalert_text_args: []\nalert_text_type: alert_text_only\ndoc_type: syslog\nfilter:\n - query:\n query_string:\n query: \'@timestamp:*\'\nimport: BaseRule.config\nindex: hannibal-*\nis_enabled: false\nname: test123\nnum_events: 10000\nrealert:\n minutes: 5\nslack_channel_override: \'#elastalert-debugging\'\nslack_msg_color: danger\nslack_title_link: undefined/rules/test123\nslack_username_override: Praeco\nterms_size: 50\ntimeframe:\n minutes: 5\ntimestamp_field: \'@timestamp\'\ntimestamp_type: iso\ntype: frequency\nuse_count_query: true\nuse_strftime_index: false\n'
+ expected - actual
query: '@timestamp:*'
import: BaseRule.config
index: hannibal-*
is_enabled: false
-match_enhancements: []
name: test123
num_events: 10000
realert:
minutes: 5
at Context.<anonymous> (dist/js/webpack:/tests/unit/specs/ConfigYaml.spec.js:49:1)
MOCHA Tests completed with 1 failure(s)
|
praeco/tests/unit/specs/ConfigYaml.spec.js add「match_enhancements: []」
[CORP\sano@a-ngft53r34ong praeco]$ npm run test:unit
> [email protected] test:unit
> vue-cli-service test:unit
Download the Vue Devtools extension for a better development experience:
https://github.com/vuejs/vue-devtools
You are running Vue in development mode.
Make sure to turn on production mode when deploying for production.
See more tips at https://vuejs.org/guide/deployment.html
WEBPACK Compiling...
[=========================] 98% (after emitting)
DONE Compiled successfully in 10599ms
[=========================] 100% (completed)
WEBPACK Compiled successfully in 10599ms
MOCHA Testing...
ConfigAlert
✓ renders the realert amount (1942ms)
✓ renders the realert unit
✓ renders the right destination (53ms)
✓ renders the right subject
✓ renders the right body
✓ renders the right slack channel (41ms)
✓ renders the right slack user
✓ renders the right slack message color
ConfigCondition log
✓ renders the numEvents (602ms)
✓ renders the aboveOrBelow
✓ renders the WHEN count
✓ renders the OVER all documents
✓ renders the UNFILTERED
✓ renders the GROUPED OVER field
✓ renders the timeframe interval
✓ renders the timeframe amount
✓ renders the WITH OPTIONS useCountQuery
✓ renders the WITH OPTIONS docType
YAML parsing
✓ renders the correct yaml (92ms)
Errors log
✓ renders the rule
✓ renders the error
Queries log
✓ renders the query log correctly (430ms)
RuleView
✓ renders the rule
Silences log
✓ renders the silence log correctly (260ms)
alertText
✓ returns config-formatted alert text
✓ returns html-formatted alert text
luceneSyntaxBuilder
✓ returns correct query string given empty querybuilder tree
✓ returns correct query string given filled querybuilder tree
✓ returns correct query string given completely filled querybuilder tree
29 passing (4s)
MOCHA Tests completed successfully |
Isn't it better to add an example of what values to enter for Start time and End time to the explanation in the input field? .. I'm wondering what format to use. If it's HH: mm format, I think it's like Time Picker's Fixed time range. The reason why I think so is that there will always be people who dare to put in strange prices and come up with various things. |
The format is HH:mm |
Are you using this pull request function in actual operation? If so, is there any problem with other functions? |
You can edit the start time and end time values when you are not in edit mode. It's a bug. |
Is there anything else? I want to fix it before merging. |
There are concerns about quality. Are you licking?
I think it is correct that Start time and End time are required check errors. Did you dare to implement it like this?
End time is required I think it is correct that the check error occurs. Did you dare to implement it like this?
I think it is correct that Start time is a required check error. Did you dare to implement it like this?
I feel that it is the correct movement to get a magnitude comparison error between Start time and End Time. |
Hey @nsano-rururu |
We are using this function in actual operation and the feature is working as expected. |
In this case, I will investigate how to implement it. ElementUI el-time-picker- only display hours, minutes, minutes and add range check Vue.js ElementUIのTimePickerに任意の値を入力する Vue.js ElementUIのTimePickerに任意の値を入力する(バリデータの追加) |
I also want to review the source code structure, so I would like to support it. We plan to develop it in another branch. I'd like to ask only for a code review of the finished product, but what about? |
I will not proceed until I get a reply |
Please make sure to use |
Since there is a conflict file, I resolved it and put the one up to the modified state of the test code in another branch. I'd like to fix it in the following branch and merge it into master if there is no problem, but how about it? |
Hey @nsano-rururu @johnsusek |
The conflict is fixed in the following branch, so no action is required.
We haven't supported el-time-select or fixed any bugs, so we will contact you if we can. We are planning to support el-time-select and make it impossible to edit when it is not in edit mode because the movement is strange even though it has a mandatory mark. |
el-time-select support, bug fixes, and source code configuration review. Please review. |
We will not proceed until we receive a reply |
Sorry for the delay again, I had very busy week. |
I'm not sure if the time steps are every 15 minutes. For some reason I don't operate a system using Praeco and ElastAlert, either at work or in private. |
I'm not particular about 15 minutes, so it can be 1 minute or 30 minutes. 1 minute to meet all your needs |
1 minute will provide a very long list of options. |
Then, do you leave it as it is? Vue.js ElementUIのTimePickerに任意の値を入力する |
I think we should leave it as it is. |
This is the work I do, but since there is a difference from the current master, I will take in the contents of master and then merge it into master. I just did another release yesterday, so I'm thinking of releasing it along with what I'm currently doing in another case. |
Merged into Praeco & elastalert-server has released a new Docker image. https://hub.docker.com/r/praecoapp/praeco |
Thanks 👍 |
Hi @johnsusek
My name is Abir and I am working with Praeco in my company (I am working with @osherdp if you remember him).
We wanted to send alerts only during specific time range in the day, so we developed a feature for Praeco.
The feature is called Time Window and the user can use it to send alerts only during specific time range.
This feature includes additions to Praeco gui and one more enhancement in Elastalert-server's elastalert_modules.
I opened pull request for johnsusek/elastalert-server: johnsusek/elastalert-server#6
Credits:
@abirsigron - my presonal account
@IamShobe for helping me with the time window gui additions.