


<decoder name="srx-rt-flow-session-close">
<parent>srx-rt-flow</parent>
<prematch>RT_FLOW_SESSION_CLOSE</prematch>
<regex offset="after_parent">(.+) (\S+) (\S+) (\S+) - (\S+) (\S+) reason="(.+)" source-address="(\S+)" source-port="(\S+)" destination-address="(\S+)" destination-port="(\S+)" service-name="(\S+)" nat-source-address="(\S+)" nat-source-port="(\S+)" nat-destination-address="(\S+)" nat-destination-port="(\S+)" src-nat-rule-name="(\S+)" dst-nat-rule-name="(\S+)" protocol-id="(\S+)" policy-name="(\S+)" source-zone-name="(\S+)" destination-zone-name="(\S+)" session-id-32="(\S+)" packets-from-client="(\S+)" bytes-from-client="(\S+)" packets-from-server="(\S+)" bytes-from-server="(\S+)" elapsed-time="(\S+)" application="(\S+)" nested-application="(\S+)" username="(\S+)" roles="(\S+)" packet-incoming-interface="(\S+)" encrypted="(\S+)"].(.+): (\S+)->(\S+) None (\S+) \S(\S+).\S+.\S+.(\S+) (\S+) (\S+) (\S+) (\S+) (\S+) (\S+) (\S+) (\S+) (\S+) \S+ (\S+) \S+</regex>
<order></order>
</decoder>
Thanks!
<decoder name="srx-rt-flow-session-close">
<prematch>RT_FLOW_SESSION_CLOSE</prematch>
<decoder name="srx-rt-flow-session-close-child">
<parent>srx-rt-flow-session-close</parent>
<regex>reason="(\.+)"</regex>
<order>reason</order>
</decoder>
<!-- This decoder will "read" the reason field only -->
<decoder name="srx-rt-flow-session-close-child">
<parent>srx-rt-flow-session-close</parent>
<regex>source-address="(\S+)"</regex>
<order>srcip</order>
</decoder>
<!-- This decoder will "read" the source-address field only -->
Have in mind you can test the decoders without restarting the Wazuh Manager service by executing the command /var/ossec/bin/ossec-logtest. Once executed if all decoders and rules are Ok, you'll be able to paste an event sample and it will show you all decoded fields (if any decoder works for it) along with the rule ID that triggered (if any rule matches).
I would recommend you to check next documents for decoders and rules customization:
https://documentation.wazuh.com/current/user-manual/ruleset/ruleset-xml-syntax/decoders.html
https://documentation.wazuh.com/current/user-manual/ruleset/ruleset-xml-syntax/rules.html
https://documentation.wazuh.com/current/user-manual/ruleset/ruleset-xml-syntax/regex.html
https://documentation.wazuh.com/current/user-manual/ruleset/ruleset-xml-syntax/index.html
Please let us know if this information was helpful!