Hi
Irakli Shavgulidze
I hope you are doing fine.
To create a decoder for this kind of events, it will necessary collect them in a single line, there is an option in
localfile configuration to collect events from
multiple lines.
This is a localfile configuration example:
<localfile>
<log_format>multi-line-regex</log_format>
<location>/oracle/oradata/TESTWSL/oraarch/adump/*</location>
<multiline_regex match="start" replace="no-replace">^\w+ \w+ \d+ \d+:\d+:\d+ \d+ \W\d+:\d+</multiline_regex>
</localfile>The idea is starts doing some test with this options, when you find the event in
/var/ossec/logs/archive/archives.json file in a single line, a decoder could be created to extract each field.
If archives.json doesn't exist set following config and restart the manager, into
ossec.conf manager side enable
<ossec_config>
<global>
<alerts_log>yes</alerts_log>
<logall>yes</logall>
<logall_json>yes</logall_json>
</global>After restar the manager, every received event will be included in
archives.json file.
To create a custom decoder you can follow
this documentation.
For example:
<decoder name="redhat-ldap-audit-logs">
<program_name>redhat-ldap-audit-logs</program_name>
</decoder>
<decoder name="redhat-ldap-audit-logs-child">
<parent>redhat-ldap-audit-logs</parent>
<regex>time: (\d+)</regex>
<order>time</order>
</decoder>
<decoder name="redhat-ldap-audit-logs-child">
<parent>redhat-ldap-audit-logs</parent>
<regex>result: (\d+)</regex>
<order>result</order>
</decoder>
<decoder name="redhat-ldap-audit-logs-child">
<parent>redhat-ldap-audit-logs</parent>
<regex>changetype: (\w+)</regex>
<order>changetype</order>
</decoder>
And finaly to make it easier to find/process the event, I would include a header into localfile to collected data.
<localfile>
<log_format>multi-line-regex</log_format>
<location>/oracle/oradata/TESTWSL/oraarch/adump/*</location>
<multiline_regex match="start" replace="no-replace">^\w+ \w+ \d+ \d+:\d+:\d+ \d+ \W\d+:\d+</multiline_regex>
<out_format>$(timestamp) $(hostname)
redhat-ldap-audit-logs: $(log)</out_format>
</localfile>
This way the program name will match with
redhat-ldap-audit-logs, and been processed by first decoder.
Let me knos if this information is useful.
Regards.