Hi Ekta
I hope you are doing fine!
I glad to know that you had created a custom decoder and rule. To achieve yours new requirements it's necessary create a new custom rule with "frequency and time frame" functionality.
Wazuh included <different_location /> option, this option specifies that the decoded location must be different. This option is used in conjunction with frequency and timeframe. It's useful if you completed location field with comming location.country field.
For your case, I guess we can use <different_field> option, as following sample:
<rule id="100002" level="10" frequency="1" timeframe="3600">
<if_matched_sid>100001</if_matched_sid> <------- Set your custom rule id
<different_field>data.location.country</different_field>
<description>Different Location Country</description> <------- Configure the name as you want
</rule>
Description:
- if_matched_sid: Number of parent rule, in this case the number of your custom rule.
- Frequency: Number of times the rule must have matched before firing. 1 time for your case.
- Timeframe: In seconds. This option is intended to be used with the frequency option. 3600 seconds for your case.
Find more samples into following link:
Let me know if that works.
Regards.