Hi Team,
I have been using Wazuh for a while now and its awesome. However, I am stuck with one requirement. We have Wazuh decoding Windows events with JSON decoder. I want to have one field which only shows the title from data.win.system.message.
Example :
"An account was logged off.
Subject:
Security ID: S-1-5-21-1251468313-4219967479-562825607-1356
Account Name: test_user
Account Domain: Sample.Domain
Logon ID: 0x24639810
Logon Type: 3
This event is generated when a logon session is destroyed. It may be positively correlated with a logon event using the Logon ID value. Logon IDs are only unique between reboots on the same computer."
I want to extract only “An account was logged off.” as data.win.system.message.title. Can this be done somehow with the JSON decoder, may be by adding a child decoder ? If it has to be done with a Rule, what would be the best approach to do this for all Windows Logs ?
Thank you In advance,
Ranjith.
<decoder name="json">
<prematch>^{\s*"</prematch>
<plugin_decoder>JSON_Decoder</plugin_decoder>
</decoder>
<decoder name="Windows-logs">
<parent>json</parent>
<prematch>^{"win"</prematch>
<regex>"message":"\\"(\.+).</regex>
<order>eventTitle</order>
</decoder>
Am I missing something ?
int DecodeWinevt(Eventinfo *lf)if (doc['data.win.system.message'].size()==0) {
return "doc with no win Message "
} else {
return doc['data.win.system.message'].value.splitOnToken('.')[0];
}

![]()
