Hello Sow,
When you experience errors like this, you can also check the ossec.log file to get an idea what the error could be.
One thing I noticed from your rules is you were using pcre2 syntax undeclared with regex, that would first trigger an error because pcre2 is not the default syntax, you should always specify in front of the regex field.
Secondly, the syntax is not accurate hence the reason for the error, wazuh would interprete the angle brackets <> as tags and would complain they need to be closed and would flag an error.
I have made some adjustments to your rule, please follow that syntax and also check the documentation below for further guidelines on wazuh rule creation and their equivalent syntax.
<group name="monit,availability,">
<!-- Suppress expected 401s from secured OpenSearch -->
<rule id="100519" level="0">
<field name="location">/var/log/monit.log</field>
<match>HTTP error: Server returned status 401</match>
<description>Monit: expected 401 (suppressed)</description>
</rule>
<!-- Endpoint down / protocol test failed -->
<rule id="100520" level="7">
<field name="location">/var/log/monit.log</field>
<regex type="pcre2">'[^']+'\s*failed\s+protocol\s+test</regex>
<description>Monit: endpoint down</description>
</rule>
<!-- Recovered -->
<rule id="100521" level="3">
<field name="location">/var/log/monit.log</field>
<match>succeeded</match>
<description>Monit: service recovered</description>
</rule>
<!-- Certificate expiring soon (6 days or fewer) -->
<rule id="100522" level="9">
<field name="location">/var/log/monit.log</field>
<regex type="pcre2">(Certificate|certificate|SSL|TLS)</regex>
<regex type="pcre2">(^|[^0-9])(0|1|2|3|4|5|6)\s*days([^0-9]|$)</regex>
<description>Monit: certificate expiring soon (6 days or fewer)</description>
<group>tls,certificate,</group>
</rule>
<!-- Alternate phrasing: "less than 6 days" -->
<rule id="100523" level="9">
<field name="location">/var/log/monit.log</field>
<regex type="pcre2">(Certificate|certificate|SSL|TLS)</regex>
<regex type="pcre2">less\s+than\s+6</regex>
<description>Monit: certificate expiring soon (less than 6 days)</description>
<group>tls,certificate,</group>
</rule>
</group>