PL EN
WB-E1D9EE74TLP:CLEARWazuh 5

Wazuh Common Schema and wazuh-events-v5 indices in Wazuh 5

Wazuh Common Schema in Wazuh 5: categories, wazuh-events-v5 and wazuh-findings-v5 streams, templates, ISM retention, queries and 4.x wazuh-alerts-* equivalents.

In Wazuh 5, data no longer goes to the daily wazuh-alerts-* and wazuh-archives-* indices. It goes to data streams with a fixed structure, the Wazuh Common Schema. Below are the WCS categories, the list of streams and indices, the templates with the retention policy, and queries against this data.

This is based on the 5.0-rc documentation, a release candidate under development, so names and settings may change. The role of findings and Sigma rules is described in the article on Sigma rules, and the architecture changes in the Wazuh 5 overview.

What the Wazuh Common Schema is

The documentation defines WCS as a standardized structure for organizing and categorizing security event data from any source, meant to ensure consistent analysis, correlation and reporting. The manager does the normalization: according to the architecture, it turns agent data into documents that conform to the schema, decodes them and enriches them with threat intelligence, then passes them to the indexer through a connector, which in version 5.0 replaces Filebeat. The WCS definitions, templates and mappings are maintained in the wazuh-indexer-plugins repository.

The documentation shows only a subset of the fields: event.original, event.category, event.type, event.action, source.geo, source.as, wazuh.threat, and the fields wazuh.agent.*, wazuh.cluster.*, wazuh.space.name and wazuh.schema.version. The pages this text is based on do not contain the full list of fields and their types.

Categories

The Key column is the identifier used in stream names, integrations, rules, decoders and the Security Analytics module. The documentation says to use it exactly in this form.

NameKeyExample log types
Access Managementaccess-managementokta, keycloak, jumpcloud
Applicationsapplicationsapache-http, nginx, google-workspace
Cloud Servicescloud-servicesaws, azure, gcp, github
Network Activitynetwork-activitycisco-asa, fortinet, pfsense, netflow
Securitysecuritycrowdstrike, suricata, m365-defender, sentinel-one
System Activitysystem-activitylinux, windows, macos, auditd
Otherotherothers_application, others_apt, others_web
Unclassifiedunclassifiedevents that could not be classified

The pipeline manages the unclassified category automatically. Do not use it as a target category for new integrations or rules.

Data streams and indices

The indexer stores data in two forms. Data streams hold data that is generated continuously and ordered in time: events, findings, active response requests and metrics. Behind a stream sit backing indices, which Wazuh rolls over and deletes according to a lifecycle policy. Stateful indices hold the last known state of the monitored endpoints: inventory, vulnerabilities and SCA results.

StreamContent
wazuh-events-raw-v5events before processing, when raw event indexing is enabled (disabled by default)
wazuh-events-v5-<category>events normalized to WCS, one stream per category
wazuh-events-v5-unclassifiedevents without a category
wazuh-findings-v5-<category>findings from Sigma rule matches through detectors
wazuh-active-responsesrequests to run an active response
wazuh-metrics-agentsoperational metrics of the endpoints
wazuh-metrics-comms-v4manager communication metrics for the legacy agent protocol (before 5.0.0)
wazuh-metrics-normalizationevent normalization (decoding) metrics
wazuh-ai-assistant-sessionsuser conversations with the AI assistant

The <category> placeholder in a name stands for a key from the category table, for example wazuh-events-v5-security. Events without a category go to wazuh-events-v5-unclassified only when indexing of such events is enabled for the space.

State indices

The wazuh-states-* indices hold the global state collected from all endpoints and are updated as the environment changes. The documentation lists:

IndexContent
wazuh-agent-config, wazuh-agent-statsthe last configuration and statistics reported by the agent, per module
wazuh-states-scaSecurity Configuration Assessment results
wazuh-states-fim-filesfile metadata from File Integrity Monitoring
wazuh-states-fim-registry-keys, wazuh-states-fim-registry-valuesmonitored Windows registry keys and values
wazuh-states-vulnerabilitiesvulnerability assessment results
wazuh-states-inventory-*inventory: users, groups, packages, processes, services, ports, networks, interfaces, protocols, hardware, system, hotfixes, browser-extensions

The Syscollector module collects the inventory, and the vulnerabilities result from comparing the inventory with data from the CTI service. These indices describe the current state and do not keep event history, so a retention policy with the delete action on the wazuh-states-* pattern is risky. This trap is described, using 4.x as the example, in the post on OpenSearch retention.

Index templates and the Setup module

Each stream has an index template that defines mappings and settings and assigns a lifecycle policy. For events, all categories, including unclassified, share one base template, plugins/setup/src/main/resources/templates/streams/events.json, and findings have their own, findings.json. At deployment the Setup module generates a template for each category, changing only index_patterns, for example to wazuh-events-v5-security*. Special streams, such as raw events and active responses, use separate files.

A simplified events template from the documentation:

{
  "index_patterns": ["wazuh-events-v5-*"],
  "priority": 1,
  "data_stream": {},
  "template": {
    "settings": {
      "plugins.index_state_management.policy_id": "stream-events-policy"
    }
  }
}

The documentation also lists stream-findings-policy and stream-active-responses-policy. On my 5.0.0-rc1 lab stack in Docker, GET /_plugins/_ism/policies returns six policies: stream-events-policy, stream-findings-policy, stream-active-responses-policy, stream-metrics-policy, stream-raw-events-policy and ai-assistant-sessions-policy. The full findings template example for the network-activity category shows, among other things, the zstd codec, a limit of 1000 fields (total_fields), one shard, auto_expand_replicas set to 0-1, number_of_replicas set to 0, and default query fields such as wazuh.agent.name and wazuh.schema.version.

All templates managed by Wazuh have priority 1, and each matches one stream. When several templates match, the indexer applies only the one with the highest priority and does not merge them. A custom template that is meant to override a Wazuh template must therefore get a higher priority.

The Setup module (package wazuh-indexer-setup) creates the templates and policies at every indexer start: it loads the definitions, creates or updates the templates and ISM policies, creates the streams and applies the mappings. The documentation warns that manual changes to templates managed by Wazuh may be overwritten after a restart. By default the module retries a failed initialization task once, and after a second failure the node shuts down so it does not run with incomplete resources. Settings in /etc/wazuh-indexer/opensearch.yml (changing them requires a restart):

SettingDefaultMeaning
plugins.setup.timeout30operation time limit in seconds, range 5-120
plugins.setup.backoff15pause between attempts in seconds, range 5-60
plugins.setup.max_retries1number of retries, 0 disables, range 0-10
plugins.setup.settings_update.enabledtruewith false, the PUT /_plugins/_setup/settings endpoint returns 403 to everyone

Retention and rollover

Rollover happens when the active backing index reaches 20 GB per primary shard or 200 million documents, whichever comes first. The wazuh-ai-assistant-sessions stream also rolls over daily. Index State Management deletes an index only once the stream has moved to a new index and the old one is older than the minimum age, counted from its creation. A failed deletion is retried up to three times.

StreamMinimum age for deletion
wazuh-events-raw-v510 minutes
wazuh-events-v5-* (with unclassified)1 hour
wazuh-findings-v5-*90 days
wazuh-active-responses3 days
wazuh-metrics-*30 days
wazuh-ai-assistant-sessions7 days

A stream that never reaches the rollover limit keeps its data until you delete it yourself. In a low-volume environment, events can therefore sit in the indexer indefinitely, while in a high-volume one the event history reaches back only to the last rollover. The documentation explicitly calls the event streams an intermediate processing layer, and after rollover the index is deleted at the next policy check. So do not treat wazuh-events-v5-* as an archive for hunting backwards. The documentation does not describe how to change the Wazuh policy thresholds, so you plan the long-term history separately, for example with snapshots.

Enabling raw and unclassified events

The engine.index_raw_events setting in the Setup module API enables raw events (default false):

PUT /_plugins/_setup/settings
Content-Type: application/json

{
  "engine": {
    "index_raw_events": true
  }
}

A correct response is 200 with the message Settings updated successfully.. A missing field or a wrong type gives 400, and disabled settings updates give 403. The setting is stored in the .wazuh-settings index.

Indexing of unclassified events is a space setting (Draft or Standard). In the dashboard you choose the space in Security Analytics, then Actions > Edit, enable Index unclassified events and save.

Querying the new indices

The documentation shows three commands that verify the installation. In Indexer management > Dev Tools or through the API:

GET /_index_template/wazuh-*
GET /_index_template/wazuh-findings-v5-network-activity-template
GET /_plugins/_ism/policies

The first lists all templates and their patterns, the second one template, the third the lifecycle policies. The data queries below are my examples, and they are not in the documentation. A query for events of one agent from the system-activity category, sorted from newest:

GET /wazuh-events-v5-system-activity*/_search
{
  "size": 20,
  "sort": [{ "@timestamp": "desc" }],
  "query": {
    "match": { "wazuh.agent.name": "agent-01" }
  }
}

The documentation does not give the type of the wazuh.agent.name field. On the 5.0.0-rc1 stack, _mapping/field shows keyword, the same for wazuh.rule.id, wazuh.rule.level and wazuh.rule.title, so match looks for an exact value here, like term. The wazuh.agent.name field is one of the default query fields in the findings template. A query for findings with the acknowledged status, taken from the documentation of the case module described in the Sigma post:

GET /wazuh-findings-v5-*/_search
{
  "query": {
    "term": { "wazuh.case.status": { "value": "acknowledged" } }
  }
}

On the 5.0.0-rc1 stack, the findings indices do not yet have the wazuh.case.status field in the mapping, so this query returns 0 hits. GET /wazuh-events-v5-*/_count gives the number of documents across all event streams.

From wazuh-alerts-* to the v5 streams

The index comparison below is my interpretation, because the 5.0-rc documentation does not give a table of index equivalents. The dashboard migration guide says only that the wazuh-alerts-* pattern is replaced by 5.x patterns. The 4.x description comes from the post on archives and alerts, based on the 4.14 documentation.

Wazuh 4.xWazuh 5.0-rcNote
wazuh-alerts-*wazuh-findings-v5-<category>documentation: findings play the role of the 4.x alerts
wazuh-archives-* (optional, through logall_json)wazuh-events-v5-<category>events are normalized, and the minimum age for deletion is short
wazuh-states-vulnerabilities-<cluster>wazuh-states-vulnerabilitiesstate, not history
split by rulesplit by category (integration)the category is part of the stream name

In 4.x, a single wazuh-alerts-* pattern covered everything, and the data path depended on Filebeat. In 5.0 you narrow a query with the category key in the stream name, and, unlike archives.json, the raw archive has to be enabled separately in the Setup module settings. This transition also changes field naming: a finding carries WCS and wazuh.* fields, so dashboards and queries based on 4.x fields have to be rewritten. The dashboard migration guide gives equivalents of the main fields, for example rule.level to wazuh.rule.level, and I collected the table in the migration post. The rules and limits of data migration are described in the post on migrating from 4.x, and the first contact with the components in the installation post.

What the documentation does not specify

The pages used in this article do not contain the full list of WCS fields or their types, the full list of ISM policies, the names of event templates beyond one findings example, or a way to change the ISM policy thresholds for streams managed by Wazuh.

Sources

↑↓ select Enter open Esc close