The thing is that the part you must be parsing in the decoder should be added to the field you hace added also on the out_log
I have checked on my side and after the change on the ossec.conf :
<localfile>
<log_format>syslog</log_format>
<location>/home/vagrant/lucho.txt</location>
<out_format>$(timestamp) MicrosoftExchange: $(log)</out_format>
</localfile>
I did an echo of the message just to simulate the incomming event:
echo "2024-05-09T00:00:19.344Z,server-name\SMTP 25,08DBBB7EF9630D76,0,192.168.56.14:192.168.56.4:55208,dasda,sadasda," >> /home/vagrant/lucho.txt
logs on archives.log (I enable logall on the ossec.conf also):
2024 May 14 17:06:12 kinetic->/home/vagrant/lucho.txt May 14 17:06:12 MicrosoftExchange: 2024-05-09T00:00:19.344Z,server-name\SMTP 25,08DBBB7EF9630D76,0,192.168.56.14:192.168.56.4:55208,dasda,sadasda,
tested with the logtest :
May 14 17:06:12 MicrosoftExchange: 2024-05-09T00:00:19.344Z,server-name\SMTP 25,08DBBB7EF9630D76,0,192.168.56.14:192.168.56.4:55208,dasda,sadasda,
**Phase 1: Completed pre-decoding.
full event: 'May 14 17:06:12 MicrosoftExchange: 2024-05-09T00:00:19.344Z,server-name\SMTP 25,08DBBB7EF9630D76,0,192.168.56.14:192.168.56.4:55208,dasda,sadasda,'
timestamp: 'May 14 17:06:12'
hostname: 'MicrosoftExchange:'
program_name: 'MicrosoftExchange'
**Phase 2: Completed decoding.
name: 'custom_mysql'
Being my decoder on local_decoder.xml :
<decoder name="custom_mysql">
<program_name>MicrosoftExchange</program_name>
<regex type="pcre2">(server-name\\SMTP \d{2,3}),([A-z0-9]+),(\d+),(\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}:587),(\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}:\d+),(\W*),(.*),(.*)</regex>
<order>connector-id,session-id,sequence-number,local-endpoint,remote-endpoint,event,data,context</order>
</decoder>
Maybe you can replicate something like it. let me know!