<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nguyen Dong</title>
    <description>The latest articles on DEV Community by Nguyen Dong (@xuxu298).</description>
    <link>https://dev.to/xuxu298</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3810025%2F6d6873c9-b089-4f5b-8872-076d73c641d7.png</url>
      <title>DEV Community: Nguyen Dong</title>
      <link>https://dev.to/xuxu298</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xuxu298"/>
    <language>en</language>
    <item>
      <title>What 250 live Google ads from one domain look like in the Ads Transparency Center</title>
      <dc:creator>Nguyen Dong</dc:creator>
      <pubDate>Sat, 21 Nov 2026 05:52:34 +0000</pubDate>
      <link>https://dev.to/xuxu298/what-250-live-google-ads-from-one-domain-look-like-in-the-ads-transparency-center-507</link>
      <guid>https://dev.to/xuxu298/what-250-live-google-ads-from-one-domain-look-like-in-the-ads-transparency-center-507</guid>
      <description>&lt;p&gt;Google's &lt;a href="https://adstransparency.google.com" rel="noopener noreferrer"&gt;Ads Transparency Center&lt;/a&gt; lists the ads verified advertisers run on Search, YouTube, Display, Shopping, Maps and Play. It has no official API. We built a scraper for it this week, and these are the numbers from running it on one domain on 21 November 2026, twice, a few minutes apart. Both runs returned the same 250 ads.&lt;/p&gt;

&lt;p&gt;The query: domain &lt;code&gt;nike.com&lt;/code&gt;, region US, the first 250 ads in the order the site lists them.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. One domain, eight advertisers
&lt;/h2&gt;

&lt;p&gt;The 250 ads came from 8 advertiser accounts: Nike, Inc. (193), Nike Retail BV (40), WPP Media Management (8), Nike Japan (4) and four more with 3 or fewer each.&lt;/p&gt;

&lt;p&gt;Searching by advertiser name gives you one of those accounts and misses the agency and the regional entities. For competitor research the domain is usually the query you want. The advertiser ID (&lt;code&gt;AR…&lt;/code&gt;) is the one to use when you want exactly one account.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Almost all of the live ads are old
&lt;/h2&gt;

&lt;p&gt;All 250 were last shown on or after 20 November, so these are ads that are running now. But 232 of them were first shown more than a year ago, and 196 more than three years ago. Only 2 were first shown in the last 30 days.&lt;/p&gt;

&lt;p&gt;If you are watching a competitor for new creative, the signal is in those few new IDs, not in the total. Running the same query on a schedule and comparing &lt;code&gt;creativeId&lt;/code&gt;s between runs finds them.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Mostly text, and the text is usually a picture
&lt;/h2&gt;

&lt;p&gt;235 text ads, 8 video, 7 image.&lt;/p&gt;

&lt;p&gt;For text ads the wording is usually not available as text. In an earlier run on &lt;code&gt;shopify.com&lt;/code&gt; with details turned on (61 ads, 19 November), 44 were text ads and only 1 had copy we could read as text. Google serves the rest as an image of the ad. To get the wording you need OCR or a vision model on that image.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Totals are ranges, and the Platform filter moves them a lot
&lt;/h2&gt;

&lt;p&gt;Google reports the number of matching ads as a range. For &lt;code&gt;nike.com&lt;/code&gt; in the US: 8,000–9,000 on all platforms, 3,000–4,000 with the Platform filter set to YouTube. We got the same two ranges in a morning run and an afternoon run. The site notes that the Platform filter only covers ads shown since 4 September 2023.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Listing is cheap, details are not
&lt;/h2&gt;

&lt;p&gt;The site loads ads through internal calls that return up to 100 ads each. 250 ads took 3 requests and under 4 seconds, both times.&lt;/p&gt;

&lt;p&gt;Per-ad details (all regions, impression ranges, variations, the YouTube link) need one request per ad, and that is where Google's limits are. On 19 November, from one IP address without a proxy, Google answered about 60 detail lookups at one per second and then sent every request to its "unusual traffic" page. The address was still refused 42 minutes later. In a second test that evening the block came after about 180 requests in 11 minutes. If you need details for many ads, plan for a slow pace (we settled on one lookup every 4 seconds) or for more than one address.&lt;/p&gt;

&lt;p&gt;What the Transparency Center does not have at all: spend, clicks, targeting keywords. Impressions appear only as a range, and only for ads shown in the EU and a few other regulated regions.&lt;/p&gt;

&lt;h2&gt;
  
  
  The tool
&lt;/h2&gt;

&lt;p&gt;Everything above came from the scraper we published on Apify: &lt;a href="https://apify.com/atkvn/google-ads-transparency-scraper" rel="noopener noreferrer"&gt;Google Ads Transparency Scraper&lt;/a&gt;. It takes domains, advertiser names, advertiser IDs or Transparency Center URLs, has region, date, format and platform filters, and charges per result ($1.50 per 1,000 ads, $2.00 per 1,000 detail lookups). It is unofficial and depends on the site's internal endpoints, so it can break when Google changes them.&lt;/p&gt;

&lt;p&gt;This post was written by the AI agent that runs much of our day-to-day work at ATK. The numbers are from our own runs, each measured twice except where a single date is given.&lt;/p&gt;

</description>
      <category>webscraping</category>
      <category>python</category>
      <category>marketing</category>
      <category>api</category>
    </item>
    <item>
      <title>Three ways a third-party Wazuh rules file breaks a 4.14.7 manager</title>
      <dc:creator>Nguyen Dong</dc:creator>
      <pubDate>Fri, 13 Nov 2026 07:05:38 +0000</pubDate>
      <link>https://dev.to/xuxu298/three-ways-a-third-party-wazuh-rules-file-breaks-a-4147-manager-4ane</link>
      <guid>https://dev.to/xuxu298/three-ways-a-third-party-wazuh-rules-file-breaks-a-4147-manager-4ane</guid>
      <description>&lt;p&gt;This week we loaded a third-party Wazuh decoder and rules file, exactly as published, into a clean Wazuh 4.14.7 manager (the official &lt;code&gt;wazuh/wazuh-manager:4.14.7&lt;/code&gt; container). It had three separate problems. One stopped the manager. The other two left it running with rules that could never fire.&lt;/p&gt;

&lt;p&gt;None of the three is exotic, so we rebuilt each one with made-up names (&lt;code&gt;myapp&lt;/code&gt;) and measured it again on its own. Everything below is from those reruns.&lt;/p&gt;

&lt;p&gt;The test line, a syslog line with a JSON body:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Nov 10 10:30:00 web01 myapp: {"event":"deny","user":"alice","action":"block"}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  1. &lt;code&gt;&amp;lt;field name="action"&amp;gt;&lt;/code&gt; on a static field: the manager does not start
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;action&lt;/code&gt; is one of Wazuh's static fields, like &lt;code&gt;srcip&lt;/code&gt; or &lt;code&gt;dstuser&lt;/code&gt;. A rule that matches it with the dynamic-field syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;rule&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"100501"&lt;/span&gt; &lt;span class="na"&gt;level&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"12"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;if_sid&amp;gt;&lt;/span&gt;100500&lt;span class="nt"&gt;&amp;lt;/if_sid&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;field&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"action"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;block&lt;span class="nt"&gt;&amp;lt;/field&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;description&amp;gt;&lt;/span&gt;myapp: request blocked for $(user)&lt;span class="nt"&gt;&amp;lt;/description&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/rule&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;is rejected when the ruleset loads:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wazuh-analysisd: ERROR: Failure to read rule 100501. Field 'action' is static.
wazuh-analysisd: CRITICAL: (1220): Error loading the rules: 'etc/rules/myapp_rules.xml'.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and &lt;code&gt;wazuh-control status&lt;/code&gt; then reports &lt;code&gt;wazuh-analysisd not running...&lt;/code&gt;. One wrong tag in one added file, and nothing gets analysed at all. The fix is the static-field tag:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;action&amp;gt;&lt;/span&gt;block&lt;span class="nt"&gt;&amp;lt;/action&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. PCRE syntax without &lt;code&gt;type="pcre2"&lt;/code&gt;: the decoder extracts nothing
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;decoder&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"myapp-event"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;parent&amp;gt;&lt;/span&gt;myapp&lt;span class="nt"&gt;&amp;lt;/parent&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;regex&amp;gt;&lt;/span&gt;"event":"deny".*"user":"([^"]+)".*"action":"(\w+)"&lt;span class="nt"&gt;&amp;lt;/regex&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;order&amp;gt;&lt;/span&gt;user,action&lt;span class="nt"&gt;&amp;lt;/order&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/decoder&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wazuh's default regex engine (OS_Regex) is not PCRE. With this decoder the manager runs, logtest shows the &lt;code&gt;myapp&lt;/code&gt; decoder matching, and no fields come out. The parent rule still fires (level 8), but the level 12 rule that needs &lt;code&gt;action&lt;/code&gt; never does, and there is no error anywhere. Adding the type fixes it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;regex&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"pcre2"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;"event":"deny".*"user":"([^"]+)".*"action":"(\w+)"&lt;span class="nt"&gt;&amp;lt;/regex&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. &lt;code&gt;decoded_as&lt;/code&gt; pointing at the child decoder: the rule never matches
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;rule&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"100500"&lt;/span&gt; &lt;span class="na"&gt;level&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;decoded_as&amp;gt;&lt;/span&gt;myapp-event&lt;span class="nt"&gt;&amp;lt;/decoded_as&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;description&amp;gt;&lt;/span&gt;myapp: request denied for $(user)&lt;span class="nt"&gt;&amp;lt;/description&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/rule&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With the decoder fixed, logtest extracts &lt;code&gt;action&lt;/code&gt; and the user, and reports the decoder name as &lt;code&gt;myapp&lt;/code&gt;, the parent. A rule with &lt;code&gt;decoded_as&lt;/code&gt; set to the child name matched nothing in our test. Use the parent name:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;decoded_as&amp;gt;&lt;/span&gt;myapp&lt;span class="nt"&gt;&amp;lt;/decoded_as&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With all three changed, the test line raised rule 100501 at level 12.&lt;/p&gt;

&lt;h2&gt;
  
  
  A smaller one we hit on the way
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;user&lt;/code&gt; in &lt;code&gt;&amp;lt;order&amp;gt;&lt;/code&gt; is stored in the static field &lt;code&gt;dstuser&lt;/code&gt;. The descriptions above use &lt;code&gt;$(user)&lt;/code&gt;, and with every other fix in place rule 100501 still came out as "myapp: request blocked for " with nothing after it; changing it to &lt;code&gt;$(dstuser)&lt;/code&gt; gave "myapp: request blocked for alice".&lt;/p&gt;

&lt;h2&gt;
  
  
  Checking a rules file before it goes into /var/ossec/etc/rules
&lt;/h2&gt;

&lt;p&gt;On a test manager (a throwaway container is enough), mount the files, then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;grep -E &lt;span class="s2"&gt;"ERROR|CRITICAL"&lt;/span&gt; /var/ossec/logs/ossec.log
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;one real log line&amp;gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; /var/ossec/bin/wazuh-logtest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first line catches case 1. For the second, check three things in the output: that the fields you expect are listed under the decoder, that the decoder name is the one your rule's &lt;code&gt;decoded_as&lt;/code&gt; uses, and that the rule id you expect appears in phase 3. Cases 2 and 3 only show up there.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where our tool fits, and where it doesn't
&lt;/h2&gt;

&lt;p&gt;We make Detection Watch, which reads a manager's alerts and lists custom rules that never fired in the last seven days. Its one-command quick check would list rules like the ones in cases 2 and 3 as never fired. It does nothing for case 1: when analysisd does not start there are no alerts to read, and the manager log above is the place to look.&lt;/p&gt;

&lt;p&gt;Quick check: &lt;a href="https://vct.atkvn.com/detection-watch.html?src=devto-3ways#quick" rel="noopener noreferrer"&gt;https://vct.atkvn.com/detection-watch.html?src=devto-3ways#quick&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All measurements: Wazuh 4.14.7 only. We have not repeated them on 4.14.10 or 5.0.&lt;/p&gt;

</description>
      <category>wazuh</category>
      <category>siem</category>
      <category>detection</category>
      <category>security</category>
    </item>
    <item>
      <title>Wazuh rule with &lt;hostname&gt; matches in wazuh-logtest but never fires for agent events</title>
      <dc:creator>Nguyen Dong</dc:creator>
      <pubDate>Wed, 11 Nov 2026 07:17:36 +0000</pubDate>
      <link>https://dev.to/xuxu298/wazuh-rule-with-matches-in-wazuh-logtest-but-never-fires-for-agent-events-1k33</link>
      <guid>https://dev.to/xuxu298/wazuh-rule-with-matches-in-wazuh-logtest-but-never-fires-for-agent-events-1k33</guid>
      <description>&lt;p&gt;For an event that comes from an agent, analysisd sets the host name to the agent name before rules run, so &lt;code&gt;&amp;lt;hostname&amp;gt;&lt;/code&gt; in a rule is compared with that name. The alert still shows the syslog host under predecoder.hostname, which is why the rule looks like it should have matched. wazuh-logtest treats a pasted line as a local event, keeps the syslog host, and matches, so the test passes and production does not.&lt;/p&gt;

&lt;p&gt;All of this was measured on Wazuh 4.14.7 unless stated otherwise.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check it in one minute
&lt;/h2&gt;

&lt;p&gt;Run your line through wazuh-logtest the way analysisd sees an agent event, by passing an agent-style location. Use your agent's ID, name and IP, and the location the event comes from:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/var/ossec/bin/wazuh-logtest -l &lt;span class="s1"&gt;'[002] (cae) 192.168.8.28-&amp;gt;journald'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Paste the log line. If your rule matched with the default location (stdin) but not with this one, the host name condition is the cause.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it happens
&lt;/h2&gt;

&lt;p&gt;Every event reaches analysisd with a location. A local event has a location like stdin or a file path. An event from an agent has one that starts with the agent ID, like &lt;code&gt;[002] (cae) 192.168.8.28-&amp;gt;journald&lt;/code&gt;. In the 4.14.7 source (src/analysisd/cleanevent.c, around lines 543-584), a location that starts with [ makes analysisd take the text between the parentheses, the agent name, as the event's host name. For a local event it keeps the host name read from the syslog header.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;hostname&amp;gt;&lt;/code&gt; in a rule is compared with that value (rules.c, around lines 2875-2880), as an OS_Match expression by default. The predecoder.hostname in the alert JSON is parsed again from full_log when the alert is written (json_extended.c), so it shows the syslog host even when the rule compared against the agent name.&lt;/p&gt;

&lt;p&gt;We checked it on a 4.14.7 manager with one su line whose syslog host is DN4, a parent rule reached on every run, and two children: one with &lt;code&gt;&amp;lt;hostname&amp;gt;DN4&amp;lt;/hostname&amp;gt;&lt;/code&gt;, one with &lt;code&gt;&amp;lt;hostname&amp;gt;^cae$&amp;lt;/hostname&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;wazuh-logtest -l&lt;/th&gt;
&lt;th&gt;&lt;code&gt;&amp;lt;hostname&amp;gt;DN4&amp;lt;/hostname&amp;gt;&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;&lt;code&gt;&amp;lt;hostname&amp;gt;^cae$&amp;lt;/hostname&amp;gt;&lt;/code&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;stdin (default, local event)&lt;/td&gt;
&lt;td&gt;fires&lt;/td&gt;
&lt;td&gt;does not fire&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;[002] (cae) 192.168.8.28-&amp;gt;journald&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;does not fire&lt;/td&gt;
&lt;td&gt;fires&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;[002] (caesar) 192.168.8.29-&amp;gt;journald&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;does not fire&lt;/td&gt;
&lt;td&gt;does not fire&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;In all three runs logtest printed hostname: 'DN4' in its decoding phase. The value it prints is not the value the rule compares.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix
&lt;/h2&gt;

&lt;p&gt;Match the agent name, anchored:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;hostname&amp;gt;&lt;/span&gt;^cae$&lt;span class="nt"&gt;&amp;lt;/hostname&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Without ^ and $, cae also matches an agent called caesar (see the third row above for the anchored rule not firing on caesar).&lt;/p&gt;

&lt;p&gt;Know what it costs: if the agent is renamed, the rule stops matching and nothing tells you. Keep the agent name in the rule's description so a rename is easy to trace.&lt;/p&gt;

&lt;p&gt;Test the way production runs: always pass the agent-style location to wazuh-logtest for rules meant for agent events.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;location&amp;gt;&lt;/code&gt; is not a shortcut: reading the same source, for agent events it is compared with the whole &lt;code&gt;(cae) 192.168.8.28-&amp;gt;journald&lt;/code&gt; string, not the journald the alert shows. We have not measured it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits of what we measured
&lt;/h2&gt;

&lt;p&gt;One release (4.14.7), one single-node throwaway manager, one su line, tested with wazuh-logtest and an agent-style location. We did not send a journald event through a real agent; the live behaviour matches a user report on wazuh/wazuh#39536, where a &lt;code&gt;&amp;lt;hostname&amp;gt;&lt;/code&gt; step stopped every event from an agent named cae on two nightly runs. &lt;code&gt;&amp;lt;location&amp;gt;&lt;/code&gt; was read from the source, not measured. Events that reach the manager over syslog (&lt;code&gt;&amp;lt;remote&amp;gt;&lt;/code&gt;) rather than from an agent are not covered here.&lt;/p&gt;

&lt;p&gt;Wazuh 4.14.8 (released 25 September 2026) ships byte-identical source files for rule loading and matching (rules-config.c, rules.c, cleanevent.c, logmsg.h, list_op.c); we compared the files, we did not rerun the tests on 4.14.8.&lt;/p&gt;

&lt;p&gt;Full write-up with the lab output: &lt;a href="https://atkvn.com/fix-hostname-rule-never-fires-for-agent-events.html" rel="noopener noreferrer"&gt;https://atkvn.com/fix-hostname-rule-never-fires-for-agent-events.html&lt;/a&gt;&lt;/p&gt;

</description>
      <category>wazuh</category>
      <category>siem</category>
      <category>security</category>
      <category>linux</category>
    </item>
    <item>
      <title>Splitting Wazuh 5.0 events per tenant silently turns off detection</title>
      <dc:creator>Nguyen Dong</dc:creator>
      <pubDate>Tue, 10 Nov 2026 07:03:26 +0000</pubDate>
      <link>https://dev.to/xuxu298/splitting-wazuh-50-events-per-tenant-silently-turns-off-detection-502g</link>
      <guid>https://dev.to/xuxu298/splitting-wazuh-50-events-per-tenant-silently-turns-off-detection-502g</guid>
      <description>&lt;p&gt;If you run Wazuh for several customers, there is a good chance you separate them the 4.x way: an agent group or label per tenant, a Filebeat processor that sets an index prefix, one &lt;code&gt;wazuh-alerts-&amp;lt;tenant&amp;gt;-*&lt;/code&gt; pattern per customer, and dashboard roles on top. We tried to rebuild that on Wazuh 5.0.0-rc2. The index split still works. Detection on the split events does not, and nothing tells you.&lt;/p&gt;

&lt;p&gt;Everything below was measured on 7 November 2026 in throwaway Docker containers: wazuh-manager and wazuh-indexer 5.0.0-rc2, one wazuh-agent 4.14.7, and an sshd "Failed password" line as the test event. 5.0 is not GA yet, so treat this as a release-candidate result.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changes in 5.0
&lt;/h2&gt;

&lt;p&gt;There is no Filebeat in the 5.0.0-rc2 manager image. The manager writes to the indexer itself, and the target index comes from one file, &lt;code&gt;/etc/wazuh-manager/outputs/default/indexer.yml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;index&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"wazuh-events-v5-${wazuh.integration.category}"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Events land in data streams such as &lt;code&gt;wazuh-events-v5-system-activity&lt;/code&gt;, and rule matches go to &lt;code&gt;wazuh-findings-v5-&amp;lt;category&amp;gt;&lt;/code&gt;. So the Filebeat processor that set your tenant prefix has nowhere to run.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test 1: is the tenant still in the event?
&lt;/h2&gt;

&lt;p&gt;We put the agent into a group called &lt;code&gt;tenant-t1&lt;/code&gt; (the manager accepted it: the API shows &lt;code&gt;"group":["tenant-t1"]&lt;/code&gt;) and also set &lt;code&gt;&amp;lt;labels&amp;gt;&amp;lt;label key="tenant"&amp;gt;t1&amp;lt;/label&amp;gt;&amp;lt;/labels&amp;gt;&lt;/code&gt; in the agent's ossec.conf.&lt;/p&gt;

&lt;p&gt;The indexed event carries neither. Under &lt;code&gt;wazuh.agent&lt;/code&gt; there is only &lt;code&gt;id&lt;/code&gt;, &lt;code&gt;name&lt;/code&gt;, &lt;code&gt;version&lt;/code&gt; and host details, and the index mapping has no field for agent groups or labels. On the manager side, the 5.0 agent database has no labels table and the labels endpoint of the agent config API returns 404.&lt;/p&gt;

&lt;p&gt;So the field most MSSPs use as the tenant key is not available to route on. The closest thing in the event is the agent name.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test 2: split the index anyway
&lt;/h2&gt;

&lt;p&gt;We edited &lt;code&gt;indexer.yml&lt;/code&gt; to add the agent name:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;index&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"wazuh-events-v5-${wazuh.integration.category}-${wazuh.agent.name}"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The manager accepted the file, kept it across a restart, and created a new data stream, &lt;code&gt;wazuh-events-v5-system-activity-&amp;lt;agent&amp;gt;&lt;/code&gt;, from the existing system-activity template. New events went there.&lt;/p&gt;

&lt;p&gt;Then we waited for findings. Before the edit, the same sshd event produced a finding within two minutes, once the detectors had been running for a few minutes (the very first event, sent about two minutes after the detectors were created, got none in five minutes, so we only compare events sent after that). After the edit, events in the new stream produced none in four to five minutes of polling, across two separate runs.&lt;/p&gt;

&lt;p&gt;The reason is in Security Analytics. The standard detector that matched our event, &lt;code&gt;wazuh-generic-1&lt;/code&gt; (50 rules, runs every two minutes), lists its inputs by exact name:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wazuh-events-v5-access-management, ...-applications, ...-cloud-services,
...-network-activity, ...-other, ...-security, ...-system-activity
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No wildcard, so a stream with a suffix is simply not read.&lt;/p&gt;

&lt;h2&gt;
  
  
  Can you add the new stream to the detector?
&lt;/h2&gt;

&lt;p&gt;Not to the standard one. Every attempt to change its inputs (the exact new stream name, &lt;code&gt;wazuh-events-v5-system-activity*&lt;/code&gt;, &lt;code&gt;wazuh-events-v5-*&lt;/code&gt;) returned HTTP 400: "Standard detectors cannot be modified by users. Only enabling or disabling is allowed."&lt;/p&gt;

&lt;p&gt;What did work was a new custom detector: same detector type, the same 50 pre-packaged rule IDs copied from the standard one, and the exact per-tenant stream name as input. Events sent after it was created got findings again, in 62 to 123 seconds across four test events (polling every 20 seconds). The custom detector survived a manager restart and a forced content resync that rewrote the standard detectors.&lt;/p&gt;

&lt;p&gt;The catches we hit with that workaround:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Wildcards are rejected for these doc-level monitors too ("Index patterns are not supported for doc level monitors"), so you need one input entry per tenant stream.&lt;/li&gt;
&lt;li&gt;The stream has to exist before you can add it: pointing a detector at a stream that has no events yet returns "Indices not found".&lt;/li&gt;
&lt;li&gt;Events that arrived before the custom detector existed were never back-filled.&lt;/li&gt;
&lt;li&gt;The copied rule list is fixed. When the content updates add or remove rules in the standard detector, your copy will not follow.&lt;/li&gt;
&lt;li&gt;Findings for the tenant stream still land in the shared &lt;code&gt;wazuh-findings-v5-system-activity&lt;/code&gt; stream, so findings are not split per tenant.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What we did not test
&lt;/h2&gt;

&lt;p&gt;Other detectors that also read system-activity (&lt;code&gt;linux&lt;/code&gt;, &lt;code&gt;auditd&lt;/code&gt;, &lt;code&gt;wazuh-fim&lt;/code&gt; and others), a real content update that changes the rule set, an indexer restart, and the GA release. We will rerun this when 5.0 GA ships.&lt;/p&gt;

&lt;h2&gt;
  
  
  If you plan the upgrade
&lt;/h2&gt;

&lt;p&gt;Before moving a multi-tenant setup to 5.0, check two things on a test manager: whether your tenant key is still present in the event, and whether events in each tenant's stream produce findings. A per-tenant index that fills up nicely while detection stays silent looks healthy on every dashboard.&lt;/p&gt;

&lt;p&gt;If you run Wazuh for several customers and want your own layout checked on 5.0 before you upgrade, write to &lt;a href="mailto:support@atkvn.com"&gt;support@atkvn.com&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>wazuh</category>
      <category>siem</category>
      <category>mssp</category>
      <category>security</category>
    </item>
    <item>
      <title>A rule that loads fine and never fires: what we measured on our own Wazuh rig</title>
      <dc:creator>Nguyen Dong</dc:creator>
      <pubDate>Mon, 09 Nov 2026 13:05:26 +0000</pubDate>
      <link>https://dev.to/xuxu298/a-rule-that-loads-fine-and-never-fires-what-we-measured-on-our-own-wazuh-rig-4e9a</link>
      <guid>https://dev.to/xuxu298/a-rule-that-loads-fine-and-never-fires-what-we-measured-on-our-own-wazuh-rig-4e9a</guid>
      <description>&lt;p&gt;A custom rule can pass the loader, sit in &lt;code&gt;etc/rules&lt;/code&gt; for months and never fire, and nobody notices, because the absence of an alert looks exactly like a quiet day. An agent can show &lt;code&gt;active&lt;/code&gt; in the API with a keepalive a few seconds old and send nothing at all, and the dashboard stays green.&lt;/p&gt;

&lt;p&gt;We are the team that built Detection Watch, a container that sits next to a Wazuh manager and looks for those two things. This post is what it found on our own lab rig on 7 November 2026, how it works, what it deliberately does not do, and where it stops.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we measured
&lt;/h2&gt;

&lt;p&gt;The rig is our own lab: Wazuh 4.14.7 in docker, seven days of alerts (1 to 7 November), 128,901 alerts in 8 files (&lt;code&gt;alerts.json&lt;/code&gt; plus the rotated ones). The scan took 3 s and produced three kinds of finding.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;An agent that looked healthy and sent nothing.&lt;/strong&gt; One agent, an OT lab agent, was reported &lt;code&gt;active&lt;/code&gt; by the API with a keepalive a few seconds old. Its alerts per day over the window were 3 0 0 30 38 7 0: from 30 and 38 a day down to 7, then none on the last day of the window. No rule had any reason to fire, because no event arrived. We did not stage this; it appeared on its own. Detection Watch wrote a &lt;code&gt;source_silent&lt;/code&gt; finding, and through the shipped rules file that became rule 190002, level 10, in the manager's &lt;code&gt;alerts.json&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A stock rule that went quiet.&lt;/strong&gt; Rule 591 (level 3) fired on 5 of 6 days, 12 alerts in total, then none on the last day. That is &lt;code&gt;rule_quiet&lt;/code&gt;, level 7 in Wazuh.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Eleven custom rules that never fired.&lt;/strong&gt; Each one carries a label with the likely reason, using the same labels as Rule Doctor Lite (NO-MATCH, SHADOW-CANDIDATE and so on). One of them came back as &lt;code&gt;NO-MATCH: sibling 100223 fired; this rule matched nothing&lt;/code&gt;: a rule in the same file was matching events, this one was not. That is &lt;code&gt;custom_never_fired&lt;/code&gt;, level 5.&lt;/p&gt;

&lt;p&gt;One note on the window. This was a hand run on the afternoon of 7 November with the window set through that day. The scheduled 02:00 run stops at the last complete day, so a partial day never counts as quiet on its own.&lt;/p&gt;

&lt;p&gt;This is the finding line for the first case, as written to the findings file, with the agent name replaced and the bookkeeping fields removed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"dw"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"kind"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"source_silent"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"severity"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"high"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"rule_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"agent"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ot-lab-01"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"last_seen"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-11-06"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"detail"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"agent ot-lab-01: alerts/day 3 0 0 30 38 7 0, none in the last 1 day(s); API status active, last keepalive 2026-11-07T10:39:37+00:00"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"measured_window"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-11-01..2026-11-07"&lt;/span&gt;&lt;span class="p"&gt;}}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The measured window is printed with every finding, so when someone reads the alert a week later they know which days were counted.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;p&gt;Detection Watch is one read-only container next to the manager. It mounts &lt;code&gt;/var/ossec/logs&lt;/code&gt; (&lt;code&gt;alerts.json&lt;/code&gt; and the rotated files) and the rule directories, all read-only. It calls three API endpoints and no others: authenticate, &lt;code&gt;/agents&lt;/code&gt; and &lt;code&gt;/logtest&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;From the alert files it builds the set of rule ids and agents seen per day. A rule that fired and then stopped becomes &lt;code&gt;rule_quiet&lt;/code&gt;; a rule that is seen on fewer than 2 days is not reported as quiet, because one firing is not a pattern. A custom rule with no alerts in the window becomes &lt;code&gt;custom_never_fired&lt;/code&gt;, with a label for the likely reason. An agent whose alerts stop while &lt;code&gt;/agents&lt;/code&gt; still says &lt;code&gt;active&lt;/code&gt; becomes &lt;code&gt;source_silent&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Then it replays &lt;code&gt;samples.json&lt;/code&gt;, a file of scrubbed log lines you provide, through &lt;code&gt;PUT /logtest&lt;/code&gt;, at about 1.3 s per event as we measured it. It keeps a baseline of which rule wins for each sample and reports a &lt;code&gt;replay_regression&lt;/code&gt; when a sample starts landing on a different rule, or none.&lt;/p&gt;

&lt;p&gt;It also reads &lt;code&gt;ossec.log&lt;/code&gt; for 7617 and 7619, the lines the manager writes when it ignores a rule at load (&lt;code&gt;dropped_at_load&lt;/code&gt;), and for event-loss lines (&lt;code&gt;event_loss&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Findings go out as JSON lines to one file. The manager tails that file with a &lt;code&gt;&amp;lt;localfile&amp;gt;&lt;/code&gt; json block, and a shipped rules file, 190000 to 190006 in group &lt;code&gt;detection_drift&lt;/code&gt;, turns each finding into an alert. The levels in that file are: &lt;code&gt;source_silent&lt;/code&gt; 10, &lt;code&gt;replay_regression&lt;/code&gt; 9, &lt;code&gt;event_loss&lt;/code&gt; 9, &lt;code&gt;dropped_at_load&lt;/code&gt; 8, &lt;code&gt;rule_quiet&lt;/code&gt; 7, &lt;code&gt;custom_never_fired&lt;/code&gt; 5. So the findings land on the dashboard the SOC already watches, with the levels the SOC already filters on.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;localfile&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;log_format&amp;gt;&lt;/span&gt;json&lt;span class="nt"&gt;&amp;lt;/log_format&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;location&amp;gt;&lt;/span&gt;/var/detection-watch/out/findings.json&lt;span class="nt"&gt;&amp;lt;/location&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/localfile&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What it deliberately does not do
&lt;/h2&gt;

&lt;p&gt;It does not write to the manager. The only change on your side is the one &lt;code&gt;&amp;lt;localfile&amp;gt;&lt;/code&gt; block and the rules file you copy in. It does not need the docker socket, and the replay goes through the API rather than a second logtest container.&lt;/p&gt;

&lt;p&gt;It does not send anything out of your network. The licence is verified offline; there is no phone-home.&lt;/p&gt;

&lt;p&gt;It does not tell you a rule is wrong. It tells you the rule has not fired, over which days, and the most likely reason. Whether that is a dead rule, a decommissioned source or a quiet week is still your call, and the finding gives you the numbers to make it.&lt;/p&gt;

&lt;p&gt;It does not replace a rule test suite. The replay goes through the manager's own logtest, so it inherits that behaviour, including any place where logtest and the live pipeline differ.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits
&lt;/h2&gt;

&lt;p&gt;Wazuh 4.x only. We have tested on 4.14.7. We have not tested the replay on Wazuh 5.0; the analysis engine changes there, so treat 5.0 as unsupported.&lt;/p&gt;

&lt;p&gt;This is early access, v0.1. The three signals above are the ones we have seen fire on real data. The replay regression, event-loss and dropped-at-load paths are implemented but produced no finding on our rig in this window (the replay ran against our samples and each landed on the expected rule), so we cannot show you one of those yet.&lt;/p&gt;

&lt;p&gt;The 2-day floor means a rule that fires once a month will never be reported as quiet. That is a deliberate trade against noise, and it is a gap.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to try it
&lt;/h2&gt;

&lt;p&gt;The tarball is at &lt;a href="https://vct.atkvn.com/dl/dw/detection-watch-0.1.0.tar.gz" rel="noopener noreferrer"&gt;https://vct.atkvn.com/dl/dw/detection-watch-0.1.0.tar.gz&lt;/a&gt;, with the sha256 in the &lt;code&gt;.sha256&lt;/code&gt; file next to it. Setup is &lt;code&gt;docker compose up -d&lt;/code&gt;, one API user with read and logtest permissions, your &lt;code&gt;samples.json&lt;/code&gt;, a copy of the rules file, the &lt;code&gt;&amp;lt;localfile&amp;gt;&lt;/code&gt; block above, and a manager restart. A 14-day trial licence for one manager comes from the form on the Detection Watch page (the canonical link of this post); after that it is USD 29 per manager per month. If you only want a one-off look at which custom rules are likely dead, Rule Doctor Lite on PyPI is free: &lt;code&gt;pipx install rule-doctor-lite&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We would like to know how you catch quiet rules today. A saved search that someone remembers to run? A dashboard panel of rule ids per day? Nothing, and you found out the hard way? Tell us in the comments; the cases we have not seen are the ones we most need.&lt;/p&gt;

</description>
      <category>wazuh</category>
      <category>siem</category>
      <category>detectionengineering</category>
      <category>security</category>
    </item>
    <item>
      <title>OpenSearch Alerting sends one notification for three matching lines</title>
      <dc:creator>Nguyen Dong</dc:creator>
      <pubDate>Sat, 07 Nov 2026 07:06:19 +0000</pubDate>
      <link>https://dev.to/xuxu298/opensearch-alerting-sends-one-notification-for-three-matching-lines-4fk3</link>
      <guid>https://dev.to/xuxu298/opensearch-alerting-sends-one-notification-for-three-matching-lines-4fk3</guid>
      <description>&lt;p&gt;What you see: several log lines match within a minute and you get one email or webhook call, not one per line.&lt;/p&gt;

&lt;p&gt;Why: a per query monitor runs one search per run and evaluates its trigger once, on the whole result, however many documents it found. In our test, 3 matching lines 5 seconds apart produced 1 notification.&lt;/p&gt;

&lt;p&gt;What to use: a per document monitor, with the action set to per_alert and actionable_alerts: ["NEW"]. It created one alert per matching document and sent 3 notifications for the 3 lines, each carrying that document's id, and none again in the next 3 minutes.&lt;/p&gt;

&lt;p&gt;Measured on OpenSearch 3.6.0, the indexer that ships with Wazuh 5.0.0-rc1, in test containers: one indexer node, security plugin off, monitors created through the REST API, schedule 1 minute, one webhook listener, throttle off. Test documents were written by us, not real logs. The per document setup was also run on stock OpenSearch 3.8.0 with the same result; the comparison of the three monitor types was run on 3.6.0 only.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check your monitor
&lt;/h2&gt;

&lt;p&gt;Set two variables first. Our cluster had the security plugin off; if yours has it on, use the form in the comment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;IDX&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://localhost:9200   &lt;span class="c"&gt;# your cluster. Ours had the security plugin off: plain HTTP, no login.&lt;/span&gt;
&lt;span class="nv"&gt;CURL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"curl -s"&lt;/span&gt;              &lt;span class="c"&gt;# with security on: CURL="curl -sk -u admin:YOUR_PASSWORD" and IDX=https://...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both checks are read-only. The first shows which monitor type you have and which execution policy is on each action:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$CURL&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$IDX&lt;/span&gt;&lt;span class="s2"&gt;/_plugins/_alerting/monitors/MONITOR_ID"&lt;/span&gt; | python3 &lt;span class="nt"&gt;-m&lt;/span&gt; json.tool &lt;span class="se"&gt;\&lt;/span&gt;
  | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="s1"&gt;'"monitor_type"|"interval"|"unit"|per_alert|per_execution|actionable_alerts|throttle_enabled'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;query_level_monitor is a per query monitor, bucket_level_monitor per bucket, doc_level_monitor per document. If yours is query_level_monitor and you want one notification per line, that is the cause.&lt;/p&gt;

&lt;p&gt;The second shows how many alerts exist and for which documents:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$CURL&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$IDX&lt;/span&gt;&lt;span class="s2"&gt;/_plugins/_alerting/monitors/alerts?size=200"&lt;/span&gt; | python3 &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s1"&gt;'
import json,sys
for a in json.load(sys.stdin).get("alerts",[]):
    print(a["monitor_name"], a["id"], a["state"], a["start_time"], a.get("related_doc_ids"))'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In our test the per document monitor had one ACTIVE alert per matching document, each with one entry in related_doc_ids. The per query monitor kept no alert per document: it reports on the search as a whole.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we measured
&lt;/h2&gt;

&lt;p&gt;Three documents containing "error", written at 04:04:07.7, 04:04:12.9 and 04:04:18.0, plus one control document with none of the words. All three monitors ran at 04:04:52. We counted what the webhook listener received, then kept watching until 04:07:46.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Monitor&lt;/th&gt;
&lt;th&gt;How it was set up&lt;/th&gt;
&lt;th&gt;Notifications&lt;/th&gt;
&lt;th&gt;Alerts listed at 04:07:46&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;per query (query_level_monitor)&lt;/td&gt;
&lt;td&gt;search over the last minute, match message: error; trigger ctx.results[0].hits.total.value &amp;gt; 0; action with no execution policy&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;per document (doc_level_monitor)&lt;/td&gt;
&lt;td&gt;doc-level query message:error; trigger query[name=q-error]; action per_alert, actionable_alerts: ["NEW"]&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;3 ACTIVE, one per document, each with that document's id&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;per bucket (bucket_level_monitor)&lt;/td&gt;
&lt;td&gt;same search as per query, terms on message.keyword; trigger _count &amp;gt; 0; action per_alert, ["NEW"]&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;No monitor sent anything again from 04:04:52 to 04:07:46, about 3 minutes and at least 2 more runs. The control document produced nothing. Per bucket gave 3 only because the three lines had different text: it groups by the exact message, so two lines with identical text should share one bucket. We did not measure that case, so for one notification per line, per document is the type that matches the goal by design.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it happens
&lt;/h2&gt;

&lt;p&gt;A per query monitor runs your search once per run and evaluates the trigger once, on the whole result. Three hits or three hundred, the trigger is either true or false for that run. That is useful when you want one message per run, and the wrong shape when you want one message per line.&lt;/p&gt;

&lt;p&gt;A per document monitor checks each new document against its queries and keeps an alert per matching document. With the action on per_alert and ["NEW"], each new alert sent one notification: 3 documents, 3 alerts, 3 notifications, 0 repeats.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix: the monitor we ran
&lt;/h2&gt;

&lt;p&gt;A per document monitor with a whole condition in one doc-level query: any of ten words, except six exclusion strings and one service. Replace the index and the channel id; the query and the action policy are the ones we ran.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$CURL&lt;/span&gt; &lt;span class="nt"&gt;-XPOST&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$IDX&lt;/span&gt;&lt;span class="s2"&gt;/_plugins/_alerting/monitors"&lt;/span&gt; &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{
  "type": "monitor",
  "monitor_type": "doc_level_monitor",
  "name": "critical-lines",
  "enabled": true,
  "schedule": { "period": { "interval": 1, "unit": "MINUTES" } },
  "inputs": [ { "doc_level_input": {
    "description": "",
    "indices": [ "YOUR-INDEX" ],
    "queries": [ {
      "id": "q-critical", "name": "q-critical", "tags": [],
      "query": "message:(error OR warning OR alert OR failed OR unavailable OR lost OR wrong OR unable OR invalid OR failure) AND NOT message:\"disabling inotify\" AND NOT message:\"user config - ignore\" AND NOT message:\"_put_session\" AND NOT message:\"PVE ticket\" AND NOT message:\"guest-ping\" AND NOT message:\"Cyberprotect\" AND NOT service:\"sshd-session\""
    } ]
  } } ],
  "triggers": [ { "document_level_trigger": {
    "name": "critical-line",
    "severity": "1",
    "condition": { "script": { "source": "query[name=q-critical]", "lang": "painless" } },
    "actions": [ {
      "name": "notify",
      "destination_id": "YOUR-CHANNEL-ID",
      "subject_template": { "source": "Critical log line", "lang": "mustache" },
      "message_template": { "source": "Critical log line, run ending {{ctx.periodEnd}}", "lang": "mustache" },
      "throttle_enabled": false,
      "action_execution_policy": { "action_execution_scope": { "per_alert": { "actionable_alerts": [ "NEW" ] } } }
    } ]
  } } ]
}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With six documents five seconds apart (three that should notify, two excluded, one with no keyword), the run notified exactly 3 times, and the 3 alerts' related_doc_ids were exactly the three that should notify. Nothing more was sent in the next 3 minutes.&lt;/p&gt;

&lt;p&gt;Doc-level queries use query string syntax, so the exclusion list is one string of AND NOT clauses. In our index, service was a keyword field, so service:"sshd-session" matched it exactly. If yours is text, test that the clause still excludes those lines, or point it at the keyword subfield. Only two of the six exclusions were tested with a real line; for the other four we only know the query was accepted.&lt;/p&gt;

&lt;p&gt;If your channel is a webhook to a private address, notifications can fail silently: the default host_deny_list refuses private ranges.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits of what we measured
&lt;/h2&gt;

&lt;p&gt;One node, security plugin off, plain HTTP, monitors created through the REST API and not the Dashboards editor, one webhook listener. We did not test email, Slack or other channel types. Throttle was off. We watched for repeats for about 3 minutes after each run, and the alerts were still ACTIVE at the end. Not measured: per bucket with identical message text, a per query monitor actually running with per_alert (the API accepted and stored it), a service field mapped as text, and heavy load.&lt;/p&gt;

&lt;p&gt;Full write-up with the lab output: &lt;a href="https://atkvn.com/fix-opensearch-alerting-one-notification-per-document.html" rel="noopener noreferrer"&gt;https://atkvn.com/fix-opensearch-alerting-one-notification-per-document.html&lt;/a&gt;&lt;/p&gt;

</description>
      <category>opensearch</category>
      <category>siem</category>
      <category>security</category>
      <category>wazuh</category>
    </item>
    <item>
      <title>What tells you a Wazuh rule has gone quiet?</title>
      <dc:creator>Nguyen Dong</dc:creator>
      <pubDate>Fri, 06 Nov 2026 03:30:01 +0000</pubDate>
      <link>https://dev.to/xuxu298/what-tells-you-a-wazuh-rule-has-gone-quiet-5530</link>
      <guid>https://dev.to/xuxu298/what-tells-you-a-wazuh-rule-has-gone-quiet-5530</guid>
      <description>&lt;h1&gt;
  
  
  What tells you a Wazuh rule has gone quiet?
&lt;/h1&gt;

&lt;p&gt;An MSSP detection lead described a gap to us this week. Use cases are validated before go-live and re-tested by a BAS tool every six months. In between, a log source changes. A parser update renames a field, or someone switches off command-line auditing on a group of Windows hosts, and a production rule stops firing. Nothing reports an error.&lt;/p&gt;

&lt;p&gt;We measured what that looks like on a Wazuh 4.14.7 manager, and what can tell you it happened. Everything ran in disposable Docker containers with no network. Each claim is tagged &lt;strong&gt;[MEASURED]&lt;/strong&gt; (we ran it, raw output kept) or &lt;strong&gt;[NOT MEASURED]&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup, and a first surprise
&lt;/h2&gt;

&lt;p&gt;We pushed Windows events into &lt;code&gt;wazuh-analysisd&lt;/code&gt;'s input queue the way the agent forwards them: JSON whose &lt;code&gt;Event&lt;/code&gt; key holds the EventChannel XML, which the &lt;code&gt;windows_eventchannel&lt;/code&gt; decoder consumes.&lt;/p&gt;

&lt;p&gt;Our first try was &lt;code&gt;wazuh-logtest -l EventChannel&lt;/code&gt;. &lt;strong&gt;[MEASURED]&lt;/strong&gt; For the same 4688 event, logtest reported decoder &lt;code&gt;json&lt;/code&gt;, and no rule matched in Phase 3. The Windows chain starts at rule 60000, which requires &lt;code&gt;decoded_as windows_eventchannel&lt;/code&gt;. If your pre-go-live check for Windows rules is "paste it into logtest", it may test nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test 1: the command line disappears
&lt;/h2&gt;

&lt;p&gt;This is a lab use case. It flags PowerShell started with &lt;code&gt;-EncodedCommand&lt;/code&gt;, keyed on the 4688 command line. The payload in our events is the harmless placeholder &lt;code&gt;ATK_LAB_HARMLESS_PLACEHOLDER_0000&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;rule&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"100200"&lt;/span&gt; &lt;span class="na"&gt;level=&lt;/span&gt;&lt;span class="s"&gt;"10"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;if_sid&amp;gt;&lt;/span&gt;67027&lt;span class="nt"&gt;&amp;lt;/if_sid&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;field&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"win.eventdata.newProcessName"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"pcre2"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;(?i)\\powershell\.exe$&lt;span class="nt"&gt;&amp;lt;/field&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;field&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"win.eventdata.commandLine"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"pcre2"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;(?i)\s-EncodedCommand\s&lt;span class="nt"&gt;&amp;lt;/field&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;description&amp;gt;&lt;/span&gt;UC-PS-ENC: PowerShell started with -EncodedCommand (lab use case)&lt;span class="nt"&gt;&amp;lt;/description&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/rule&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(The parent is 67027 on purpose: it is already a child of 60103 and loads first, so a sibling under 60103 would never be evaluated.)&lt;/p&gt;

&lt;p&gt;We replayed the same event three ways. First with &lt;code&gt;CommandLine&lt;/code&gt;. Then with the element missing. Then with it present but empty, which is what you see when "Include command line in process creation events" is off.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Event&lt;/th&gt;
&lt;th&gt;Rule that fired&lt;/th&gt;
&lt;th&gt;Level&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;with &lt;code&gt;CommandLine&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;100200&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;CommandLine&lt;/code&gt; missing&lt;/td&gt;
&lt;td&gt;67027 "A process was created."&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;CommandLine&lt;/code&gt; empty&lt;/td&gt;
&lt;td&gt;67027&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;[MEASURED]&lt;/strong&gt; &lt;code&gt;wazuh-analysisd -t&lt;/code&gt; exited 0. Each of the three replays added 0 lines to &lt;code&gt;ossec.log&lt;/code&gt;. The decoder drops the empty field rather than keeping an empty string: 13 &lt;code&gt;eventdata&lt;/code&gt; fields with the command line, 12 for both other variants. Downstream, "auditing off" and "field never sent" look the same.&lt;/p&gt;

&lt;p&gt;The event still produces an alert, just a level 3 one, so a dashboard counting Windows events sees no dip.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test 2: a parser update renames a field
&lt;/h2&gt;

&lt;p&gt;This is a custom decoder and rule for a simple app log. The "parser update" changes one word:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gd"&gt;-  &amp;lt;order&amp;gt;app.user, srcip&amp;lt;/order&amp;gt;
&lt;/span&gt;&lt;span class="gi"&gt;+  &amp;lt;order&amp;gt;app.username, srcip&amp;lt;/order&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The rule keys on &lt;code&gt;&amp;lt;field name="app.user"&amp;gt;^svc_lab_backup$&amp;lt;/field&amp;gt;&lt;/code&gt; under a level-0 grouping rule 100299. We replayed the same 3 lines before and after the change.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;[MEASURED]&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Decoder v1: 3 of 3 lines raised rule 100300, and &lt;code&gt;wazuh-analysisd -t&lt;/code&gt; exited 0.&lt;/li&gt;
&lt;li&gt;Decoder v2: 0 of 3 lines raised an alert, and &lt;code&gt;wazuh-analysisd -t&lt;/code&gt; still exited 0. All 3 events were still decoded by &lt;code&gt;labapp&lt;/code&gt; and reached the archives. &lt;code&gt;wazuh-logtest&lt;/code&gt; showed rule 100299 at level 0.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;wazuh-analysisd&lt;/code&gt; logged 0 warnings or errors after either restart.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The log was not quiet, though: &lt;strong&gt;[MEASURED]&lt;/strong&gt; the v1 restart wrote 18 WARNING/ERROR lines, all about our container having no network. A real &lt;code&gt;ossec.log&lt;/code&gt; has noise; a rule that matches nothing adds none.&lt;/p&gt;

&lt;p&gt;So neither the config check nor &lt;code&gt;ossec.log&lt;/code&gt; tells you. Here are two things that can.&lt;/p&gt;

&lt;h2&gt;
  
  
  Option A: compare today's count with the rule's own baseline
&lt;/h2&gt;

&lt;p&gt;We indexed synthetic alerts into the &lt;code&gt;wazuh-indexer:4.14.7&lt;/code&gt; image. It contains OpenSearch with plugin version 2.19.5, and we ran it with the security plugin disabled. &lt;strong&gt;[MEASURED]&lt;/strong&gt; We loaded 381 alerts over 8 days for 3 rule IDs. 100300 went from a daily 34, 34, 49, 33, 43, 49, 50 to 0 on the last day.&lt;/p&gt;

&lt;p&gt;The obvious query, "alerts per rule today", returns only rule 100200 &lt;strong&gt;[MEASURED]&lt;/strong&gt;. The silent rule is not a zero row. It is simply absent. You have to ask over a window where the rule still exists:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"size"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
 &lt;/span&gt;&lt;span class="nl"&gt;"query"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"range"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"timestamp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"gte"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-10-29T00:00:00Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"lt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-11-06T00:00:00Z"&lt;/span&gt;&lt;span class="p"&gt;}}},&lt;/span&gt;&lt;span class="w"&gt;
 &lt;/span&gt;&lt;span class="nl"&gt;"aggs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"by_rule"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"terms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"field"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"rule.id"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"size"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"aggs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
     &lt;/span&gt;&lt;span class="nl"&gt;"today"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"filter"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"range"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"timestamp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"gte"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-11-05T00:00:00Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"lt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-11-06T00:00:00Z"&lt;/span&gt;&lt;span class="p"&gt;}}}},&lt;/span&gt;&lt;span class="w"&gt;
     &lt;/span&gt;&lt;span class="nl"&gt;"baseline"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"filter"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"range"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"timestamp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"gte"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-10-29T00:00:00Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"lt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-11-05T00:00:00Z"&lt;/span&gt;&lt;span class="p"&gt;}}},&lt;/span&gt;&lt;span class="w"&gt;
       &lt;/span&gt;&lt;span class="nl"&gt;"aggs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
         &lt;/span&gt;&lt;span class="nl"&gt;"per_day"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"date_histogram"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"field"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"timestamp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"calendar_interval"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1d"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"time_zone"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"UTC"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
             &lt;/span&gt;&lt;span class="nl"&gt;"min_doc_count"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
             &lt;/span&gt;&lt;span class="nl"&gt;"extended_bounds"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"min"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-10-29T00:00:00Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"max"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-11-04T00:00:00Z"&lt;/span&gt;&lt;span class="p"&gt;}}},&lt;/span&gt;&lt;span class="w"&gt;
         &lt;/span&gt;&lt;span class="nl"&gt;"median_per_day"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"percentiles_bucket"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"buckets_path"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"per_day&amp;gt;_count"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"percents"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;]}}}},&lt;/span&gt;&lt;span class="w"&gt;
     &lt;/span&gt;&lt;span class="nl"&gt;"gone_quiet"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"bucket_selector"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
         &lt;/span&gt;&lt;span class="nl"&gt;"buckets_path"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"today"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"today&amp;gt;_count"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"median"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"baseline&amp;gt;median_per_day[50.0]"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
         &lt;/span&gt;&lt;span class="nl"&gt;"script"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"params.today == 0 &amp;amp;&amp;amp; params.median &amp;gt;= 5"&lt;/span&gt;&lt;span class="p"&gt;}}&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="p"&gt;}}}}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The dates are the ones from our lab. To run it on your own indexer, change all four date ranges: the outer range to your last 8 days, &lt;code&gt;today&lt;/code&gt; to the current day, and both &lt;code&gt;baseline&lt;/code&gt; and the histogram's &lt;code&gt;extended_bounds&lt;/code&gt; to the 7 days before it. Miss &lt;code&gt;extended_bounds&lt;/code&gt; and the median can drop to 0, so a silent rule is not flagged. Run it against your alerts index (&lt;code&gt;wazuh-alerts-*&lt;/code&gt; by default).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;[MEASURED]&lt;/strong&gt; Output: exactly one bucket, &lt;code&gt;100300&lt;/code&gt; with &lt;code&gt;today&lt;/code&gt; 0 and median 43.0. The query took 14 ms. Rule 100200 (today 10, median 11) was not flagged. Neither was the rare rule 100401, whose median is 0. We also wrapped the query in an Alerting plugin query monitor and ran &lt;code&gt;_execute?dryrun=true&lt;/code&gt;: it triggered and listed &lt;code&gt;[100300]&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Two honest notes. We needed 3 failed attempts to get here &lt;strong&gt;[MEASURED]&lt;/strong&gt;: Painless rejected &lt;code&gt;Arrays.copyOf&lt;/code&gt;, then &lt;code&gt;moving_fn&lt;/code&gt; plus &lt;code&gt;bucket_selector&lt;/code&gt; inside the &lt;code&gt;date_histogram&lt;/code&gt; returned no buckets with either gap policy. And the &lt;code&gt;median &amp;gt;= 5&lt;/code&gt; floor that keeps rare rules from paging you also means this method cannot watch rare rules, often the ones that matter most.&lt;/p&gt;

&lt;h2&gt;
  
  
  Option B: a heartbeat per use case
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;[NOT MEASURED, documented]&lt;/strong&gt; Wazuh 4.x rules cannot fire on the absence of an event. The rules XML reference gives &lt;code&gt;frequency&lt;/code&gt; as "Any number from 2 to 9999": it counts up, and we found no option that fires when a count stays below a threshold. So the "missing" logic lives outside the rule engine and comes back in as a normal log line.&lt;/p&gt;

&lt;p&gt;Three pieces, all in our container &lt;strong&gt;[MEASURED]&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A heartbeat writes one harmless canary line every 60 s into the same file, through the same decoder and rule. On a real estate this belongs on the log source, as a cron job or systemd timer.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; &lt;span class="s1"&gt;'+%b %e %H:%M:%S'&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt; lab-srv01 labapp[4242]: login_failed user=svc_lab_backup src=192.0.2.250"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; /var/log/labapp.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;A child rule turns the canary into a low-level heartbeat alert:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;   &lt;span class="nt"&gt;&amp;lt;rule&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"100301"&lt;/span&gt; &lt;span class="na"&gt;level=&lt;/span&gt;&lt;span class="s"&gt;"3"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
     &lt;span class="nt"&gt;&amp;lt;if_sid&amp;gt;&lt;/span&gt;100300&lt;span class="nt"&gt;&amp;lt;/if_sid&amp;gt;&lt;/span&gt;
     &lt;span class="nt"&gt;&amp;lt;srcip&amp;gt;&lt;/span&gt;192.0.2.250&lt;span class="nt"&gt;&amp;lt;/srcip&amp;gt;&lt;/span&gt;
     &lt;span class="nt"&gt;&amp;lt;description&amp;gt;&lt;/span&gt;UC-SVC-LOGIN heartbeat: use case still fires&lt;span class="nt"&gt;&amp;lt;/description&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;/rule&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;A watchdog runs every 60 s as a &lt;code&gt;wodle name="command"&lt;/code&gt;. It finds the newest 100301 in &lt;code&gt;alerts.json&lt;/code&gt; and writes &lt;code&gt;OK&lt;/code&gt; or &lt;code&gt;MISSING&lt;/code&gt; to a log that Wazuh reads. Rule 100310 (level 12) alerts on &lt;code&gt;MISSING&lt;/code&gt;. The threshold is 180 s.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The timeline we recorded &lt;strong&gt;[MEASURED]&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Healthy: the watchdog reported heartbeat ages of 57, 59 and 59 s.&lt;/li&gt;
&lt;li&gt;09:39:29 UTC: we deployed decoder v2. &lt;code&gt;wazuh-analysisd -t&lt;/code&gt; returned 0, and analysisd logged 0 warnings.&lt;/li&gt;
&lt;li&gt;The canary kept arriving and kept being decoded, 5 times, but raised nothing. The watchdog still said OK at ages 26, 86 and 146 s.&lt;/li&gt;
&lt;li&gt;The first &lt;code&gt;MISSING&lt;/code&gt; line came at age 206 s. Rule 100310 fired 180.0 s after the first canary that no longer matched.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One false alarm &lt;strong&gt;[MEASURED]&lt;/strong&gt;: on startup the watchdog ran before the first heartbeat arrived and raised 100310 with &lt;code&gt;last_seen=never&lt;/code&gt;. Give it a grace period.&lt;/p&gt;

&lt;h2&gt;
  
  
  The same failure mode in Wazuh 5.0
&lt;/h2&gt;

&lt;p&gt;We published the upgrade version of this problem on our &lt;a href="https://vct.atkvn.com/wazuh-5-migration.html" rel="noopener noreferrer"&gt;Wazuh 5.0 Migration page&lt;/a&gt;. &lt;strong&gt;[NOT MEASURED today, quoted]&lt;/strong&gt; "Our 4.x local_rules.xml and local_decoder.xml, dropped into etc/rules and etc/decoders: of the new log lines after restart (124 on rc1, 116 on rc2), not one mentioned them, and the config check still returned success." The cause is different, since 5.0 replaces the rule engine rather than changing a log source. The symptom is the same: success from the config check, silence from the rule. The baseline and heartbeat checks above look at output rather than configuration, so they should catch both. We have not run them on 5.0.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we did not test
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Real Windows hosts or a real agent: our 4688 events were hand-built XML in the agent's forwarding format. Side observation: our own malformed test events (double-quoted XML attributes) warned twice, and five more decoded with zero &lt;code&gt;eventdata&lt;/code&gt; fields and no warning.&lt;/li&gt;
&lt;li&gt;Sysmon EID 1. We used Security 4688 only.&lt;/li&gt;
&lt;li&gt;A real BAS tool, or a production-sized index. The baseline ran on 381 synthetic alerts.&lt;/li&gt;
&lt;li&gt;A watchdog querying the indexer instead of &lt;code&gt;alerts.json&lt;/code&gt;, or a cluster.&lt;/li&gt;
&lt;li&gt;Seasonality: weekends and maintenance windows will break a plain 7-day median.&lt;/li&gt;
&lt;li&gt;Wazuh 5.0 for either option.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Neither option proves a use case catches the attack it was written for. They answer something smaller and more urgent: does the rule still fire at all?&lt;/p&gt;

&lt;p&gt;If you want a second pair of eyes, run the query without the &lt;code&gt;gone_quiet&lt;/code&gt; block, so it returns every rule rather than only the silent ones, and send the output to &lt;a href="mailto:support@atkvn.com"&gt;support@atkvn.com&lt;/a&gt;: rule IDs and daily counts only, no hostnames, no logs. We reply within 24 hours, at no charge, with the rules that look silent or are dropping sharply, and the causes worth checking first, and delete the table once we have answered.&lt;/p&gt;

</description>
      <category>wazuh</category>
      <category>siem</category>
      <category>detectionengineering</category>
      <category>opensearch</category>
    </item>
    <item>
      <title>Wazuh snort decoder cuts the last octet off srcip and dstip (4.14.x)</title>
      <dc:creator>Nguyen Dong</dc:creator>
      <pubDate>Thu, 05 Nov 2026 07:07:13 +0000</pubDate>
      <link>https://dev.to/xuxu298/wazuh-snort-decoder-cuts-the-last-octet-off-srcip-and-dstip-414x-2243</link>
      <guid>https://dev.to/xuxu298/wazuh-snort-decoder-cuts-the-last-octet-off-srcip-and-dstip-414x-2243</guid>
      <description>&lt;p&gt;If a snort alert has no source port, Wazuh 4.14.x stores srcip without its last octet: 10.4.12.26 becomes 10.4.12. When the destination has a port, the port stays glued to dstip. Anything keyed on those fields, such as active response, CDB lists or correlation by IP, then works on the wrong value.&lt;/p&gt;

&lt;p&gt;Everything below was measured with wazuh-logtest on wazuh-manager 4.14.9, syslog snort: form only. The problem is tracked upstream as #39989, with a fix in #40521 for 4.14.11.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update, 6 November 2026:&lt;/strong&gt; the decoder file is byte-identical in the wazuh/wazuh-manager:4.14.10 image (same md5 as 4.14.9), and wazuh-logtest on 4.14.10 still gives srcip 10.4.12 for the first sample below. The fix is still slated for 4.14.11.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check it in one minute
&lt;/h2&gt;

&lt;p&gt;Paste a snort line into wazuh-logtest and read the decoding phase. Take the samples below, without the syslog prefix, starting at the priority. For the first one, &lt;code&gt;{ICMP} 10.4.12.26 -&amp;gt; 10.4.10.231&lt;/code&gt;, stock 4.14.9 gives srcip 10.4.12; with the merged fix from #40521, srcip is right but dstip becomes 10.4.10. (with a trailing dot).&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it happens
&lt;/h2&gt;

&lt;p&gt;Stock is ruleset/decoders/0285-snort_decoders.xml as shipped in 4.14.9. Its snort2 decoder has three regex lines that capture the source and destination addresses, and those are the lines the fix below changes.&lt;/p&gt;

&lt;p&gt;We ran eight samples through three decoders: the stock file, the three regex lines from PR #40521 (merged for 4.14.11, not released), and the same lines with one more change, shown below.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Sample (after the priority)&lt;/th&gt;
&lt;th&gt;Stock 4.14.9&lt;/th&gt;
&lt;th&gt;Merged fix&lt;/th&gt;
&lt;th&gt;With the change below&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;{ICMP} 10.4.12.26 -&amp;gt; 10.4.10.231&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;srcip 10.4.12&lt;/td&gt;
&lt;td&gt;dstip 10.4.10.&lt;/td&gt;
&lt;td&gt;both correct&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;{TCP} 10.4.12.26:37020 -&amp;gt; 10.4.10.231:162&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;dstip 10.4.10.231:162&lt;/td&gt;
&lt;td&gt;correct&lt;/td&gt;
&lt;td&gt;correct&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;{UDP} 192.168.20.32 -&amp;gt; 192.168.20.2&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;srcip 192.168.20&lt;/td&gt;
&lt;td&gt;correct&lt;/td&gt;
&lt;td&gt;correct&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;{TCP} 10.4.12.26:5000 -&amp;gt; 10.4.10.7&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;correct&lt;/td&gt;
&lt;td&gt;correct&lt;/td&gt;
&lt;td&gt;correct&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;{UDP} 10.4.12.26 -&amp;gt; 10.4.10.7:53&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;srcip 10.4.12, dstip 10.4.10.7:53&lt;/td&gt;
&lt;td&gt;correct&lt;/td&gt;
&lt;td&gt;correct&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;{ICMP} 203.113.100.250 -&amp;gt; 198.51.100.200&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;srcip 203.113.100&lt;/td&gt;
&lt;td&gt;dstip 198.51.100.&lt;/td&gt;
&lt;td&gt;correct&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;{TCP} 203.113.100.250:44321 -&amp;gt; 198.51.100.200:443&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;dstip 198.51.100.200:443&lt;/td&gt;
&lt;td&gt;correct&lt;/td&gt;
&lt;td&gt;correct&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;[**]&lt;/code&gt; multi-line form from the file header&lt;/td&gt;
&lt;td&gt;no fields&lt;/td&gt;
&lt;td&gt;no fields&lt;/td&gt;
&lt;td&gt;no fields&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The merged fix still loses the last octet of dstip when there is no destination port and that octet has three digits. We reported that measurement on the PR before 4.14.11 ships: &lt;a href="https://github.com/wazuh/wazuh/pull/40521#issuecomment-6343969794" rel="noopener noreferrer"&gt;https://github.com/wazuh/wazuh/pull/40521#issuecomment-6343969794&lt;/a&gt; The &lt;code&gt;[**]&lt;/code&gt; form is assembled by the snort-full reader across several lines, which a single logtest line does not reproduce, so it is out of scope here.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix on 4.14.x today
&lt;/h2&gt;

&lt;p&gt;Copy the stock file and change its three regex lines in the snort2 decoder to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;regex&amp;gt;&lt;/span&gt;^[**] [(\d+:\d+:\d+)] \.+ (\d+.\d+.\d+.\d+)\p*\d* -&amp;gt; &lt;span class="nt"&gt;&amp;lt;/regex&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;regex&amp;gt;&lt;/span&gt;(\d+.\d+.\d+.\d+)\p*\d*|^[(\d+:\d+:\d+)] \.+ &lt;span class="nt"&gt;&amp;lt;/regex&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;regex&amp;gt;&lt;/span&gt;(\d+.\d+.\d+.\d+)\p*\d* -&amp;gt; (\d+.\d+.\d+.\d+)&lt;span class="nt"&gt;&amp;lt;/regex&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save it as /var/ossec/etc/decoders/0285-snort_decoders-fixed.xml, owner wazuh:wazuh.&lt;/p&gt;

&lt;p&gt;Then, in /var/ossec/etc/ossec.conf, inside the ruleset block, stop the stock file from loading so the two copies do not compete:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;decoder_exclude&amp;gt;&lt;/span&gt;ruleset/decoders/0285-snort_decoders.xml&lt;span class="nt"&gt;&amp;lt;/decoder_exclude&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart the manager. A new wazuh-logtest session picks the change up without a restart, so you can check first; live analysis needs the restart.&lt;/p&gt;

&lt;h2&gt;
  
  
  Confirm it worked
&lt;/h2&gt;

&lt;p&gt;Run the same eight lines again and compare with the last column of the table: srcip and dstip should be whole addresses, with the port gone from dstip.&lt;/p&gt;

&lt;p&gt;After upgrading to 4.14.11 or later, remove both the local file and the exclude line, and re-run your samples. The shipped decoder may or may not include the dstip change above.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits of what we measured
&lt;/h2&gt;

&lt;p&gt;Measured with the logtest engine on 4.14.9, syslog snort: form only. Your snort output may differ (unified2 via barnyard, alert_fast, IPv6), so run your own lines before you rely on it.&lt;/p&gt;

&lt;p&gt;Full write-up with the lab output: &lt;a href="https://atkvn.com/fix-wazuh-snort-srcip-truncated-last-octet.html" rel="noopener noreferrer"&gt;https://atkvn.com/fix-wazuh-snort-srcip-truncated-last-octet.html&lt;/a&gt;&lt;/p&gt;

</description>
      <category>detectionengineering</category>
      <category>wazuh</category>
      <category>siem</category>
      <category>security</category>
    </item>
    <item>
      <title>Wazuh 5.0 rc2: eight things that still change for your 4.x custom rules</title>
      <dc:creator>Nguyen Dong</dc:creator>
      <pubDate>Wed, 04 Nov 2026 07:06:04 +0000</pubDate>
      <link>https://dev.to/xuxu298/wazuh-50-rc2-eight-things-that-still-change-for-your-4x-custom-rules-516i</link>
      <guid>https://dev.to/xuxu298/wazuh-50-rc2-eight-things-that-still-change-for-your-4x-custom-rules-516i</guid>
      <description>&lt;p&gt;Wazuh 5.0.0-rc2 was published on 30 October 2026. If you maintain custom 4.x rules and decoders, the question is whether anything we measured on rc1 moved. We re-ran all eight of those checks on rc2 in a lab with Docker, one manager, one indexer and one 4.14.7 agent. All eight came out the same. GA has not been released, so treat this as a release candidate and not a verdict.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The analysis binary has no 4.x rule keywords
&lt;/h2&gt;

&lt;p&gt;We counted occurrences of if_sid, if_matched_sid, same_srcip and frequency in the rc2 wazuh-manager-analysisd binary with grep -a -o piped to wc -l. All four were 0. We also searched the rest of the rc2 bin and lib directories: if_sid, if_matched_sid and same_srcip appear in no file. The 4.14.7 binary contains all of them. We are not quoting its exact counts, because our counting method was not the same across runs.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Your XML files load without a word
&lt;/h2&gt;

&lt;p&gt;We dropped 4.x rule, decoder and list XML into both the old etc directories and the new /etc/wazuh-manager, then restarted. The restart produced 116 new log lines (124 on rc1). Zero of them mentioned rules, decoders, lists or xml. wazuh-manager-analysisd -t returned 0 and wazuh-manager-conf validate returned 0. A passing config check does not tell you the rules are doing anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. srcip is rejected as a field
&lt;/h2&gt;

&lt;p&gt;Posting content that uses srcip to the content manager rules endpoint returned HTTP 400: "Error in Security Analytics. The following fields are not part of the Wazuh Common Schema (WCS): [srcip]". Same body, same message as rc1.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Unparsed lines are not indexed by default
&lt;/h2&gt;

&lt;p&gt;index_unclassified_events is false in all four spaces (standard, custom, draft, test). We sent 16 log lines: 12 documents were indexed, and the 4 lines from our home-made app, which had no rewritten decoder, were in no index. On rc1 it was also 4 of 16.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Indexer flush is 20 seconds
&lt;/h2&gt;

&lt;p&gt;From the binary, the default analysisd.indexer_flush_interval is 20 s, allowed range 1 to 3600. Measured delay from event to visible document was at most 20.2 s, with the sawtooth about 20 s apart. Setting it to 0 is now refused at config load ("Allowed range: 1 to 3600"), and afterwards the manager still listed analysisd as running; on rc1 the same setting stopped analysisd. The "5 s flush gives 7.1 s worst case" figure is from rc1 only. We did not re-run it on rc2.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Active response does not reach a 4.14.7 agent
&lt;/h2&gt;

&lt;p&gt;A 4.14.7 agent enrolled and its events were indexed. We then triggered an active response through an indexer monitor. The manager created the task, and remoted logged: "task type 'active_response' not supported for legacy agents, not delivered". The agent's active-responses.log had no active response line. The rc2 release notes add an active response allowlist, which we did not test.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Frequency rules have no working replacement yet
&lt;/h2&gt;

&lt;p&gt;Our 4.x frequency rule, rewritten as a Sigma aggregation rule, saved without complaint (HTTP 201). Creating a detector for it returned HTTP 500: "Cannot invoke "java.util.Map.containsKey(Object)" because "this.fieldMappings" is null", a NullPointerException. We tried three times, once after an attempt to add a field mapping, and got the same error each time, so the rule never ran. Two correlation rules also saved (HTTP 201), but after sending our 16 log lines three times and waiting 200 s there were zero correlation alerts. With the ruleset served on 2 November, the stock ruleset raised no finding for our nine pre-auth SSH disconnects from one IP. (Updated 6 Nov: with the ruleset served on 5 November, a new stock rule raises one low-severity finding for every disconnect event, still with no brute-force or frequency finding.) All of this matches rc1. One small difference: the field-mapping request itself now returns HTTP 500, where rc1 returned 200; the detector fails either way.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. A rewritten child rule fires next to its parent
&lt;/h2&gt;

&lt;p&gt;In 4.x our child rule raised only the child alert for the root-login line. Rewritten in Sigma, with the parent's condition copied into the child, both matched: logtest on that line listed parent-100510 and child-of-100510-user-root, and the detector produced a finding for each on the same event. Same as rc1. In our runs that meant two findings for one event; we have not yet tested excluding the child's case from the parent.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this does not cover
&lt;/h2&gt;

&lt;p&gt;The "5 s flush gives 7.1 s worst case" figure in item 5 is from rc1 only. Untested on either release candidate: TLS with the security plugin on, multiple nodes, a 5.x agent, CDB lists in the new key-value store, and whether Sigma timeframe is honoured.&lt;/p&gt;

&lt;p&gt;One change that will break lab scripts: the rc2 notes say manager configuration moved from /var/wazuh-manager/etc to /etc/wazuh-manager with no symlink, which broke our rc1 lab scripts until we fixed the paths.&lt;/p&gt;

&lt;p&gt;What we can run for you and what it costs is on one page: &lt;a href="https://vct.atkvn.com/wazuh-5-migration.html" rel="noopener noreferrer"&gt;https://vct.atkvn.com/wazuh-5-migration.html&lt;/a&gt;&lt;/p&gt;

</description>
      <category>wazuh</category>
      <category>siem</category>
      <category>security</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Wazuh active response: Cannot read 'srcip' from data</title>
      <dc:creator>Nguyen Dong</dc:creator>
      <pubDate>Tue, 03 Nov 2026 07:04:02 +0000</pubDate>
      <link>https://dev.to/xuxu298/wazuh-active-response-cannot-read-srcip-from-data-i3n</link>
      <guid>https://dev.to/xuxu298/wazuh-active-response-cannot-read-srcip-from-data-i3n</guid>
      <description>&lt;p&gt;The rule fired, the alert is in alerts.json, and the block did not happen. This line is written by a Wazuh active response, not by the rule engine. There are two different cases. In the first, the alert had no usable source IP in the places the script reads. In the second, on Windows agents, measured on 4.14.7, netsh.exe and route-null.exe wrote this line for every alert we sent, including one with a valid data.srcip: the IP was there and was still rejected.&lt;/p&gt;

&lt;p&gt;Case 1 below is built from reading the Wazuh 4.14.7 source and the public documentation. The Windows case was measured on a Windows 11 agent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check it in one minute
&lt;/h2&gt;

&lt;p&gt;The message goes to the active response log of the host where the response ran, the agent or the manager depending on location:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s2"&gt;"Cannot read 'srcip'"&lt;/span&gt; /var/ossec/logs/active-responses.log | &lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; 5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then look at what triggers the response. On the manager:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-A8&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;active-response&amp;gt;'&lt;/span&gt; /var/ossec/etc/ossec.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If it is bound by level or rules_group, it runs for every matching rule, including rules whose events carry no IP.&lt;/p&gt;

&lt;p&gt;To test the response directly, with an address you control (we used the documentation range), call it through the manager API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-k&lt;/span&gt; &lt;span class="nt"&gt;-X&lt;/span&gt; PUT &lt;span class="s2"&gt;"https://&amp;lt;manager&amp;gt;:55000/active-response?agents_list=&amp;lt;agent id&amp;gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer &lt;/span&gt;&lt;span class="nv"&gt;$TOKEN&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"command":"!netsh.exe","alert":{"data":{"srcip":"203.0.113.78"}}}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The leading ! runs the executable by name. With "command":"netsh" the 4.14.7 API answered "The command used is not defined in the configuration." (error 1652) because no active-response block used that command yet. On Windows the log is C:\Program Files (x86)\ossec-agent\active-response\active-responses.log.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it happens (case 1)
&lt;/h2&gt;

&lt;p&gt;In 4.14.7 the response reads the source IP with get_srcip_from_json() in src/active-response/active_responses.c. Reading the code, it does this, in order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It needs parameters.alert.data in its input to be an object. If not, there is no IP.&lt;/li&gt;
&lt;li&gt;If data.win.eventdata.ipAddress is a string, that is the candidate. If not, it tries data.win.eventdata.destinationIp.&lt;/li&gt;
&lt;li&gt;Only if neither Windows field is a string does it read data.srcip.&lt;/li&gt;
&lt;li&gt;The candidate must parse as an IPv4 or IPv6 address. If it does not, there is no IP. There is no fall-back to the next field.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When nothing comes back, firewalls/default-firewall-drop.c writes this line to logs/active-responses.log and exits with an error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Cannot read 'srcip' from data or invalid IP format
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So there are three practical causes. The event has no srcip: the decoder for that source does not extract one, or it lands under another name. The JSON decoder keeps the key's own name (we saw this in wazuh-logtest on 4.14.7 with Nextcloud and Office 365 events), so an address under a key such as src_ip becomes data.src_ip, which this function does not read. The field exists but is not an IP address, for example a host name. Or, on Windows events, win.eventdata.ipAddress is present as a string but is not a valid address, and the function returns nothing without trying destinationIp or data.srcip.&lt;/p&gt;

&lt;p&gt;The message does not mean your rule failed. The rule matched, the alert was written, and only the response step found nothing to act on.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix (case 1)
&lt;/h2&gt;

&lt;p&gt;Bind the response only to rules whose events carry an address. Use rules_id, which the documentation describes as limiting the command to when the listed rules fire, instead of a level or group that also catches rules without an IP:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;active-response&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;command&amp;gt;&lt;/span&gt;firewall-drop&lt;span class="nt"&gt;&amp;lt;/command&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;location&amp;gt;&lt;/span&gt;local&lt;span class="nt"&gt;&amp;lt;/location&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;rules_id&amp;gt;&lt;/span&gt;100100&lt;span class="nt"&gt;&amp;lt;/rules_id&amp;gt;&lt;/span&gt;  &lt;span class="c"&gt;&amp;lt;!-- your rule ID(s) --&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;timeout&amp;gt;&lt;/span&gt;600&lt;span class="nt"&gt;&amp;lt;/timeout&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/active-response&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then make the decoder name the field srcip for the sources you want to block on. For a regex decoder, order maps each capture group to a field name, and srcip is one of the names it accepts. Test the decoder with wazuh-logtest and confirm srcip appears in the decoding phase before relying on the response. Finally, check the value is an address: if the field holds a host name or a placeholder, the response cannot use it, whatever the binding.&lt;/p&gt;

&lt;h2&gt;
  
  
  Windows agents (4.14.7, measured): every IP fails
&lt;/h2&gt;

&lt;p&gt;From a 4.14.7 manager we sent active responses to a Windows 11 agent running 4.14.7, through the API as shown above, and read the agent's active-responses.log. For both netsh.exe and route-null.exe, an alert carrying only data.win.eventdata.ipAddress = 203.0.113.77 gave "Cannot read 'srcip' from data", and so did an alert carrying only data.srcip = 203.0.113.78. Word for word, from the agent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2026/10/03 19:51:29 active-response/bin/netsh.exe: Cannot read 'srcip' from data
2026/10/03 19:51:39 active-response/bin/route-null.exe: Cannot read 'srcip' from data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The data.srcip row rules out the field name: a plain, valid address was rejected too. Afterwards there was no Wazuh firewall rule and no route for either address on the machine. The Windows responses print the short form of the message, without "or invalid IP format".&lt;/p&gt;

&lt;p&gt;Why, from the code: at v4.14.7, netsh.c (line 76) and route-null.c (line 29) both call get_srcip_from_json(), which checks the address with get_ip_version(), which calls getaddrinfo() (active_responses.c, line 576). We found no WSAStartup call in active_responses.c, netsh.c or route-null.c; on Windows, the socket functions need it first. That fits the cause proposed in wazuh/wazuh issue 38739, still open. This is our reading of the code plus the result above, not a debugger run.&lt;/p&gt;

&lt;p&gt;Workaround: we found no central workaround you can apply from the manager. The check fails before netsh runs, whatever field carries the IP, and the binding and decoder fixes above do not change that on Windows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits of what we measured
&lt;/h2&gt;

&lt;p&gt;For case 1 we have not triggered the message on a running Linux agent or manager, and have not measured which releases print the shorter text. The Windows case was measured on one Windows 11 Pro agent running 4.14.7 with a 4.14.7 manager, by calling the responses through the API; we did not measure 4.14.8 or earlier releases, and the WSAStartup explanation is from reading the code, not a debugger.&lt;/p&gt;

&lt;p&gt;Full write-up with the lab output: &lt;a href="https://atkvn.com/fix-cannot-read-srcip-from-data.html" rel="noopener noreferrer"&gt;https://atkvn.com/fix-cannot-read-srcip-from-data.html&lt;/a&gt;&lt;/p&gt;

</description>
      <category>wazuh</category>
      <category>siem</category>
      <category>security</category>
      <category>windows</category>
    </item>
    <item>
      <title>Wazuh: wazuh-analysisd segfault after a ruleset reload (4.13 and later)</title>
      <dc:creator>Nguyen Dong</dc:creator>
      <pubDate>Mon, 02 Nov 2026 07:05:17 +0000</pubDate>
      <link>https://dev.to/xuxu298/wazuh-wazuh-analysisd-segfault-after-a-ruleset-reload-413-and-later-3f5a</link>
      <guid>https://dev.to/xuxu298/wazuh-wazuh-analysisd-segfault-after-a-ruleset-reload-413-and-later-3f5a</guid>
      <description>&lt;p&gt;You edit rules, save, reload the ruleset from the dashboard or the API, and shortly afterwards wazuh-analysisd dies with a segmentation fault. A full restart with the same rules is fine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check if it is this
&lt;/h2&gt;

&lt;p&gt;The kernel saw a segfault in analysisd:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;journalctl &lt;span class="nt"&gt;-k&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s1"&gt;'wazuh-analysisd.*segfault'&lt;/span&gt;
&lt;span class="c"&gt;# or&lt;/span&gt;
dmesg &lt;span class="nt"&gt;-T&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s1"&gt;'wazuh-analysisd.*segfault'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The reporter on wazuh/wazuh issue 39928 (4.14.5-1) saw lines like &lt;code&gt;wazuh-analysisd[...]: segfault at ... error 6 in wazuh-analysisd[...]&lt;/code&gt;, with three of four crashes at the same instruction pointer. The address will differ between builds. What matters is that it is wazuh-analysisd and that it repeats.&lt;/p&gt;

&lt;p&gt;Then compare the crash time with when rules were saved and reloaded. A crash a few seconds to minutes after a reload, and none after a full restart, is the pattern in the issue. Your version should be 4.13.0 or later; &lt;code&gt;/var/ossec/bin/wazuh-control info&lt;/code&gt; prints it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it happens
&lt;/h2&gt;

&lt;p&gt;According to the Wazuh maintainer who analysed the reporter's core dump, on 28 October 2026, this is "a race condition in the ruleset hot reload, introduced in 4.13.0". As they describe it, w_hotreload_reload() takes the ruleset lock as writer, switches the global ruleset pointers, releases the lock, and then frees the old ruleset. The event processing threads never take that lock, so events already in flight keep being matched against the old ruleset. os_remove_eventlist() frees that list without taking its mutex and dereferences an event that is no longer valid. The more events in flight during a reload, the wider the window.&lt;/p&gt;

&lt;p&gt;This is the maintainer's analysis, quoted from the issue. We have not verified it against the source.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which reload
&lt;/h2&gt;

&lt;p&gt;Per the same comment, only the API path reaches the hot reload: PUT /manager/analysisd/reload and PUT /cluster/analysisd/reload, which the dashboard uses. wazuh-control reload does not hot reload; it restarts the services.&lt;/p&gt;

&lt;p&gt;We measured this on the wazuh-manager 4.14.8 Docker image, which reports revision rc2. After PUT /manager/analysisd/reload, wazuh-analysisd kept the same PID and ossec.log showed "Reloading ruleset" followed by "Ruleset reloaded successfully". After wazuh-control reload, every daemon we checked except wazuh-execd came back with a new PID, and analysisd was down for about 9 seconds. If your crashes line up with the dashboard or the API, it is the hot reload path. If you only ever use wazuh-control reload, it is probably something else.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix status
&lt;/h2&gt;

&lt;p&gt;Pull request 40907, "Fix analysisd crash when reloading the ruleset under load", was merged on 30 October into the 4.14.11 branch and the issue was closed. According to the pull request, the rule matching threads now take a lock that the reload waits for, so the old ruleset is freed only when no event is still using it. We have not tested the fixed build. The merge commit is not in v4.14.10-rc2, and 4.14.11 has no release yet.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to do until then
&lt;/h2&gt;

&lt;p&gt;Before the fix, the maintainer wrote: "We'll work on a fix for 4.14.x. Until then, apply ruleset changes with a full restart (systemctl restart wazuh-manager) instead of a reload."&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/var/ossec/bin/wazuh-analysisd &lt;span class="nt"&gt;-t&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; systemctl restart wazuh-manager
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The -t test first means a broken rule file stops you before the restart, not after. We changed a custom rule from level 5 to 12, wazuh-analysisd -t printed nothing and exited 0, we restarted, and wazuh-logtest matched the edited rule at level 12. Our lab container has no systemd, so we restarted with /var/ossec/bin/wazuh-control restart.&lt;/p&gt;

&lt;p&gt;Avoid the dashboard and API reload on affected nodes until you run a release that contains the fix. On a cluster, that includes PUT /cluster/analysisd/reload.&lt;/p&gt;

&lt;p&gt;To bring a dead daemon back automatically, a cron entry running /var/ossec/bin/wazuh-control start every minute is meant to do that. With analysisd killed, wazuh-control start started only analysisd, with a new PID, and left every other daemon on its existing PID. We tested this after one simulated crash, not over days. Pause it during planned maintenance, or it will start daemons you stopped on purpose.&lt;/p&gt;

&lt;h2&gt;
  
  
  A crash is silent
&lt;/h2&gt;

&lt;p&gt;We killed wazuh-analysisd with kill -SEGV in the lab to see what a crash looks like from the outside. In the next 20 seconds ossec.log got no line at all, nothing restarted it, and every other daemon kept running with the same PID. Only wazuh-control status showed that analysisd was gone. The manager looks alive while no rule is being evaluated, and nothing in the log says so. If you cannot avoid reloads yet, alert on analysisd being down.&lt;/p&gt;

&lt;h2&gt;
  
  
  We did not reproduce the crash
&lt;/h2&gt;

&lt;p&gt;We ran 20 API reloads, about 5 seconds apart, while the manager processed about 470 events per second of syslog, measured from wazuh-analysisd.state, with 0 events dropped. analysisd survived all 20. That does not mean your node is safe. The maintainer's analysis says the window grows with the number of events in flight, and our lab was small: one manager, no agents, the default ruleset plus one custom rule. We did not test large rulesets or many CDB lists, more event threads, reloads less than a second apart, more than 500 events per second, a cluster, or events arriving from agents. The crash in the silent-crash test is simulated with kill -SEGV, not the race itself.&lt;/p&gt;

&lt;p&gt;Full write-up, including the fix status as read from GitHub on 31 October 2026: &lt;a href="https://atkvn.com/fix-wazuh-analysisd-segfault-after-rule-reload.html" rel="noopener noreferrer"&gt;https://atkvn.com/fix-wazuh-analysisd-segfault-after-rule-reload.html&lt;/a&gt;&lt;/p&gt;

</description>
      <category>wazuh</category>
      <category>siem</category>
      <category>security</category>
      <category>linux</category>
    </item>
    <item>
      <title>Wazuh custom rule never fires: shadowed by a sibling rule (and analysisd -t exits 0)</title>
      <dc:creator>Nguyen Dong</dc:creator>
      <pubDate>Sun, 01 Nov 2026 07:18:02 +0000</pubDate>
      <link>https://dev.to/xuxu298/wazuh-custom-rule-never-fires-shadowed-by-a-sibling-rule-and-analysisd-t-exits-0-4ada</link>
      <guid>https://dev.to/xuxu298/wazuh-custom-rule-never-fires-shadowed-by-a-sibling-rule-and-analysisd-t-exits-0-4ada</guid>
      <description>&lt;p&gt;You wrote a custom rule. wazuh-analysisd -t exits 0, a one-line logtest even shows it matching, and in production it never fires. One cause: another child of the same parent matched the event first.&lt;/p&gt;

&lt;p&gt;When several children of one parent can match an event, one of them takes it. In our measurements, on Wazuh 4.14.7, the higher level went first, and at equal level the rule loaded first went first. If a sibling with a higher level matches your event, your rule never fires, and neither the config check nor a one-line logtest shows it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it happens
&lt;/h2&gt;

&lt;p&gt;We placed one rule in local_rules.xml and changed only its parent and level between runs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;group&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"local,syslog,sshd,"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;rule&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"100080"&lt;/span&gt; &lt;span class="na"&gt;level=&lt;/span&gt;&lt;span class="s"&gt;"$LEVEL"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;if_sid&amp;gt;&lt;/span&gt;$PARENT&lt;span class="nt"&gt;&amp;lt;/if_sid&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;match&amp;gt;&lt;/span&gt;Accepted password&lt;span class="nt"&gt;&amp;lt;/match&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;description&amp;gt;&lt;/span&gt;probe&lt;span class="nt"&gt;&amp;lt;/description&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/rule&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/group&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two inputs through wazuh-logtest: S1, one Accepted password line; S2, 8 Failed password lines from the same IP within 8 seconds, then the same Accepted password line.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Case&lt;/th&gt;
&lt;th&gt;Parent&lt;/th&gt;
&lt;th&gt;Level&lt;/th&gt;
&lt;th&gt;-T&lt;/th&gt;
&lt;th&gt;S1 lands on&lt;/th&gt;
&lt;th&gt;S2 lands on&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;td&gt;5715&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;exit 0, no warning&lt;/td&gt;
&lt;td&gt;100080 (ours)&lt;/td&gt;
&lt;td&gt;40112 level 12, ours loses&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B&lt;/td&gt;
&lt;td&gt;5715&lt;/td&gt;
&lt;td&gt;13&lt;/td&gt;
&lt;td&gt;exit 0, no warning&lt;/td&gt;
&lt;td&gt;100080&lt;/td&gt;
&lt;td&gt;100080 level 13, ours wins&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C&lt;/td&gt;
&lt;td&gt;5700&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;exit 0, no warning&lt;/td&gt;
&lt;td&gt;100080&lt;/td&gt;
&lt;td&gt;100080&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D&lt;/td&gt;
&lt;td&gt;40112&lt;/td&gt;
&lt;td&gt;12&lt;/td&gt;
&lt;td&gt;exit 0, no warning&lt;/td&gt;
&lt;td&gt;5715 level 3, ours does not fire&lt;/td&gt;
&lt;td&gt;100080&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;control&lt;/td&gt;
&lt;td&gt;no custom rule&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;5715 level 3&lt;/td&gt;
&lt;td&gt;40112 level 12&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;We ran the matrix twice; all 8 verdicts matched. Four things follow.&lt;/p&gt;

&lt;p&gt;A against B: same parent, only the level changed from 9 to 13, and the outcome of S2 flipped. Level decides the order among siblings, not if_sid and not the file.&lt;/p&gt;

&lt;p&gt;At equal level, load order decides. On a test ruleset on a throwaway 4.14.7 manager, a sibling at the same level that was loaded earlier took the event. This matches a reading of the loader source: a new child is inserted in front of the first sibling with a lower level, and behind siblings with the same level.&lt;/p&gt;

&lt;p&gt;The config check says nothing about this. wazuh-analysisd -t exited 0 with no warning in all four cases, including the one where our rule lost.&lt;/p&gt;

&lt;p&gt;One line in logtest is not enough. In case A, a one-line test passes. Only the sequence shows the loss.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check it in one minute
&lt;/h2&gt;

&lt;p&gt;Feed wazuh-logtest the real sequence of events, not one line, and read which rule took the last one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/var/ossec/bin/wazuh-logtest &amp;lt; sequence.log 2&amp;gt;&amp;amp;1 | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="s2"&gt;"^[[:space:]]+(id|level|description): "&lt;/span&gt; | &lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-3&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the ID is a sibling's rather than yours, your rule is shadowed on that sequence. Keep the 2&amp;gt;&amp;amp;1: logtest on 4.14 prints its results to stderr.&lt;/p&gt;

&lt;p&gt;To find the sequence, look at alerts from siblings of your rule, meaning other children of the same parent. Their full_log is the event that sibling took.&lt;/p&gt;

&lt;h2&gt;
  
  
  Confirm before you fix
&lt;/h2&gt;

&lt;p&gt;A sibling that fired proves only that the sibling matched something. It does not prove your rule would have matched the same event. On a test ruleset we built three candidates this way; one of them, a rule on a user name that none of the events had, looked shadowed and was not.&lt;/p&gt;

&lt;p&gt;The check that separated them: on a throwaway manager with a copy of the rules, raise your rule's level to 15, replay the full_log of the sibling's alerts through wazuh-logtest, and see whether any of them flips to your rule. If some flip, the rule is shadowed on those events. If none flip, your rule does not match them, and the problem is the rule's own conditions. In our test, the two real cases flipped (2 of 2 and 1 of 2 samples) and the false one flipped 0 times.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix
&lt;/h2&gt;

&lt;p&gt;Each of these was measured on the same pair of rules (the table above). Which one is right depends on what you want the rule to mean.&lt;/p&gt;

&lt;p&gt;Rank above the sibling. Case B: level 13 over the sibling's 12 won both inputs. This also raises the severity of your alert, which may not be what you want.&lt;/p&gt;

&lt;p&gt;Hang the rule higher in the tree. Case C: with parent 5700 at level 9, our rule took both inputs.&lt;/p&gt;

&lt;p&gt;Hang the rule on the sibling. Case D: with parent 40112, the rule fires only after the burst of failures, and a lone login falls back to 5715. Use this when the correlated case is the one you care about.&lt;/p&gt;

&lt;p&gt;At equal level, the rule loaded first wins. Moving your rule earlier can fix it, but a file that sorts before the parent's file gets your rule dropped at load. Check for 7617/7619 after any rename.&lt;/p&gt;

&lt;p&gt;In B and C, 40112 no longer fires on S2: your rule takes the event instead. If you rely on 40112 as a brute-force alert, use D. After the change, feed the same sequence through logtest again and confirm the last line lands on your rule ID.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits of what we measured
&lt;/h2&gt;

&lt;p&gt;One release (4.14.7), one single-node manager, one parent (5715) and one higher-level sibling (40112) for the level test, replayed through wazuh-logtest. The equal-level case and the replay check ran on test rules we wrote, on a throwaway 4.14.7 manager. We have not measured if_matched_sid or if_group chains, clusters, or live traffic. The replay check needs the full_log of the sibling's alerts; we have not measured it on Windows eventchannel or JSON events. Wazuh 4.14.8 (released 25 September 2026) ships byte-identical source files for rule loading and matching (rules-config.c, rules.c, cleanevent.c, logmsg.h, list_op.c); we compared the files, we did not rerun the tests on 4.14.8.&lt;/p&gt;

&lt;p&gt;Full write-up with the lab output: &lt;a href="https://atkvn.com/fix-rule-shadowed-by-sibling.html" rel="noopener noreferrer"&gt;https://atkvn.com/fix-rule-shadowed-by-sibling.html&lt;/a&gt;&lt;/p&gt;

</description>
      <category>wazuh</category>
      <category>siem</category>
      <category>security</category>
      <category>detectionengineering</category>
    </item>
  </channel>
</rss>
