Hello again!
If you need to add more than one
<url>, I suggest you add them in the same rule so you don't have to create a new rule every time.
Also, considering the recommendations in
Custom rules and decoders, the new customs rules should be written in
etc/rules/local_rules.xml. This file won't be overwritten during upgrades. Also, the ID of custom rules should be in the range of 100000 to 120000, to avoid conflicts in the future.
So here is the result
<rule id="100002" level="10">
<description>Squid: Attempt to access forbidden file(test).</description>
</rule>
On the other hand, you are having a match with another log because there is a typo in the first example I sent to you. I apologize for any inconvenience.
If you look closely at the above example, the last <url> doesn't end with | . And if you only have one tag, then we don't need to use this character at all.
If we do, we'll have a match with any value of the field instead of those detailed.
Finally, when the results in the
wazuh-logtest binary are satisfactory, restart the manager to apply the changes.
Then, if you still don't see the alerts in the Discovery tab, you could temporarily enable the
logall option in the manager. This will save all the logs in
/var/ossec/logs/archives/archives.log even when they don't trigger a rule. This will confirm that the logs are arriving at the manager and that they are correct.
Then, disable the option because the
archives.log file could consume too much space in your disk.
Regards.