Checking your decoder I could have these findings:
1. Checking if there was another decoder that could be conflicted:
------------------------------------------------------
May 16 18:43:43 mail amavis[23420]: (23420-01) Passed CLEAN {RelayedInternal,RelayedOutbound}, ORIGINATING_POST/MYNETS LOCAL [127.0.0.1]:46806 <a..@.p> -> <r9@h.m>,<a..@.p>, Queue-ID: B2BD91F27FAF, Message-ID: <466631821.596.1684280598263.JavaMail.zimbra@.p>, mail_id: zicVENCrvOAP, Hits: -101.804, size: 2229, queued_as: 8BBD61F27E56/AFA351F2806F, 24903 ms
**Phase 1: Completed pre-decoding.
full event: 'May 16 18:43:43 mail amavis[23420]: (23420-01) Passed CLEAN {RelayedInternal,RelayedOutbound}, ORIGINATING_POST/MYNETS LOCAL [127.0.0.1]:46806 <a..@.p> -> <r9@h.m>,<a..@.p>, Queue-ID: B2BD91F27FAF, Message-ID: <466631821.596.1684280598263.JavaMail.zimbra@.p>, mail_id: zicVENCrvOAP, Hits: -101.804, size: 2229, queued_as: 8BBD61F27E56/AFA351F2806F, 24903 ms'
timestamp: 'May 16 18:43:43'
hostname: 'mail'
program_name: 'amavis'
**Phase 2: Completed decoding.
No decoder matched.
------------------------------------------------------
I could not find a decoder from wazuh that could be crossed by your new decoder.
2. Checking your decoder:
-----------------------------------------------------
May 16 18:43:43 mail amavis[23420]: (23420-01) Passed CLEAN {RelayedInternal,RelayedOutbound}, ORIGINATING_POST/MYNETS LOCAL [127.0.0.1]:46806 <a..@.p> -> <r9@h.m>,<a..@.p>, Queue-ID: B2BD91F27FAF, Message-ID: <466631821.596.1684280598263.JavaMail.zimbra@.p>, mail_id: zicVENCrvOAP, Hits: -101.804, size: 2229, queued_as: 8BBD61F27E56/AFA351F2806F, 24903 ms
**Phase 1: Completed pre-decoding.
full event: 'May 16 18:43:43 mail amavis[23420]: (23420-01) Passed CLEAN {RelayedInternal,RelayedOutbound}, ORIGINATING_POST/MYNETS LOCAL [127.0.0.1]:46806 <a..@.p> -> <r9@h.m>,<a..@.p>, Queue-ID: B2BD91F27FAF, Message-ID: <466631821.596.1684280598263.JavaMail.zimbra@.p>, mail_id: zicVENCrvOAP, Hits: -101.804, size: 2229, queued_as: 8BBD61F27E56/AFA351F2806F, 24903 ms'
timestamp: 'May 16 18:43:43'
hostname: 'mail'
program_name: 'amavis'
**Phase 2: Completed decoding.
name: 'postfix_amavis'
-----------------------------------------------------
I could not find the fields that you are trying to get from the log.
In order to make it simple:
1. I recommend to you to follow this structure:
<decoder name="name_of_decoder">
<prematch>{the fixed structure of the log you want to decode, this will be written with regex}></prematch>
<regex>{the complete regex for detecting fields that you want to get from the log}</regex>
<orders>{name of the fields (dict)}</orders>
</decoder>
2. Use /var/ossec/bin/wazuh-logtest to check if the decoder is working ( you have to restart it always you are tying an update from your decoder)
3. After you can check that decoder is working, create the rule.
Here you have a clear example of use case.
Please do not hesitate in contacting me if you need further information.
Here I am attaching some official
documentation in case you want to recheck.
Antonio