Hi,
Sure i will create a custom rule example for the first keys of the log following the same steps as explained in our guide
here.
First we create a new decoder in /var/ossec/etc/decoders/local_decoders.xml
<decoder name="full_log_decoding_example">
<program_name> ^full_log_decoding_example</program_name>
</decoder>
<decoder name="first_key_example">
<parent> full_login_decoding_example</parent>
<regex> Type '(\=w+)' msg '(=\w+\(\d+.\d+:\d+\):)'
<order> type, msg </order>
</decoder>
Then we create a custom rule in /var/ossec/etc/rules/local_rules.xml
<rule id="100010" level="0">
<program_name> full_log_decoding_example </program_name>
<description> Type msg</description>
</rule>
I recommend check this
guide to learn how to use regex to get all the info from logs.
For example:
- \w : Matches any word character
- \d : Matches any digit character
It's important to confirm that the formats are constant before creating a decoder to always match the received log.
Hope this helps.
Best Regards,
On Tuesday, March 7, 2023 at 4:40:39 AM UTC-3 Alert SMS wrote:
I want all fields to be dynamic, everything that comes to me from /var/log/audit.log from the agents
I use the same key, it doesn't change
Can you give me a step by step example on the log above?