When a Wazuh custom decoder is the fix for application logs
When an in-house application or an unsupported device sends logs that Wazuh does not parse, no rule can match the fields you care about. A custom decoder maps those raw lines to named fields, and rules then test those fields. Without the decoder, the event is stored as unparsed text, so a rule that checks a user name, a source address or an error code has nothing to evaluate. The first job is therefore to confirm that the gap is at the decoding stage, not in the rule logic.
The Wazuh server analyzes data from agents with decoders and rules, and it runs decoders on data collected from agents and on syslog received from agentless devices. Before writing anything, check whether the log already has a decoder you can use. Wazuh ships predefined decoders and rules for many products, and a log in a standard format such as JSON may be handled by the built-in JSON decoder without any custom work (see the sibling topic on parsing JSON logs). A custom decoder is the right fix when the format is specific to your application or device and no existing decoder extracts the fields your detections need.
Decide which fields the detections require before you write the decoder. A decoder only earns its place if it extracts values that a rule will compare, such as an action, an outcome, a user or a client address. Pull a representative set of sample lines from each log type, including error and edge-case lines, and note which ones should produce alerts. Confirm the exact decoder and rule syntax, and the decoding phases, against the documentation for your Wazuh 4.14 build, because configuration details can change between patch releases. Start with the Wazuh components documentation to confirm where the server's decoding role sits in your architecture, and test each decoder with sample logs on a non-production server before deployment.
Decoder design choices and when each fits
This table compares the main ways to get an application log parsed on a Wazuh server: the built-in JSON decoder, a standalone decoder, a parent and child pair, and the collection path that delivers the line. Read each row against your log format and the number of message types you need to parse, then check the maintenance and risk columns before committing to a design.
| Option | When it fits | Maintenance cost | Main risk |
|---|---|---|---|
| JSON log format with built-in JSON decoder | The application writes one JSON object per line and field names are stable | Low: mostly tracking field renames in rules | Silent misses when a field is renamed or nested differently after an application update |
| Single standalone decoder | One simple line format with a fixed prefix and a few values to extract | Low to moderate: one regex or offset set to keep current with the format | A regex that matches sample lines but fails on edge cases such as empty fields or extra spaces |
| Parent and child decoder pair | A family of messages sharing a common header, such as a timestamp, service name and process, with different payloads | Moderate: the parent changes rarely, but each child needs its own tests | Child decoders that never match because the parent consumes the header in an unexpected way |
| Syslog forwarding to the Wazuh server | Network devices or services that already send syslog and can point at the manager | Low for collection, but parsing still depends on decoder work | Losing lines through UDP drops or unexpected header formats that the decoder does not expect |
| Localfile collection by the agent | Applications that write to files on a host where an agent is already installed | Moderate: each file path and log rotation pattern needs configuration on the agent | Agent configuration that is not applied to every host, leaving some logs uncollected |
| Pre-decoding only, with rules on raw fields | A log where the program name or timestamp is all that is needed for a first-pass match | Low, but limited extraction means rules become harder to write | Rules that match too broadly because the message content is never parsed into fields |
Building and testing a decoder from sample logs
This sequence turns raw application log lines into a tested decoder set, where each field a rule needs is extracted and confirmed before the decoder reaches a production Wazuh server. It gives the team a repeatable path from sample collection to deployment that can be reviewed and repeated after changes.
Collect representative sample lines
The application owner and the security engineer gather real log lines covering each event type, error path and format variant the decoder must handle. Remove passwords, tokens, personal data and internal hostnames before the samples leave the source system, and keep an unredacted copy only where your data handling policy allows it. The step is done when the sample set includes every event type the detection team needs, and each line has been checked against the application's logging code or documentation so its layout is known.
Confirm how the log reaches Wazuh
Identify the transport the application uses, such as a file on an agent, syslog from a device, or an API probe, and confirm the exact location or sender. Check the
localfileor remote syslog configuration on the agent or manager, the timestamp format and whether the line begins with a fixed prefix. The step is done when a test line written at the source appears in the Wazuh server's archive or alert output with the expected location, so decoding problems are not mistaken for ingestion problems.Write the pre-decoder and parent decoder
The decoding engineer writes a pre-decoder that matches the fixed prefix of each line, such as the program name or a constant header, and a parent decoder that identifies the application and its common fields. Keep decoder names stable and descriptive, and store the files in a version-controlled repository alongside the rule files. The step is done when logtest shows the pre-decoded fields and the parent decoder name on every sample line, with no sample falling through to a generic decoder.
Add child decoders for each event type
Write one child decoder per event type, each linked to the parent and using a regular expression or order-based extraction to capture the fields that detections need, such as user, source address, action and result. Use distinct field names that match the rule conditions planned for the use case. The step is done when each sample line for an event type matches its own child decoder and the extracted fields show the expected values, with no field left empty when the sample contains it.
Test each sample with wazuh-logtest
Run every sample line through wazuh-logtest on the Wazuh server and record the decoder name, the extracted fields and the rule that fires for each. Keep the samples and the expected results together so a later change can be compared against them. For session handling and how logtest phases are read, follow the sibling topic on testing Wazuh rules and decoders with wazuh-logtest. The step is done when each sample returns the expected decoder, expected fields and expected rule ID, and any mismatch is documented and fixed before the next step.
Test edge cases and malformed lines
Add lines with missing optional fields, unusual characters, truncated entries and format changes from earlier application versions, and confirm the decoder fails safely. A line that does not match should fall to a known decoder or be discarded without breaking the other child decoders. The step is done when the malformed set produces no unexpected alerts and no field carries data from a neighboring event, which the security team can confirm by reviewing logtest output for each case.
Deploy and confirm in production
Copy the tested decoder files to the Wazuh server in the planned change window, restart or reload the manager as the documentation for your version describes, and monitor the archive for the live log source. Confirm that the fields in live alerts match the logtest results for the same event types. The step is done when a sample of live events shows the expected decoder and fields in the dashboard, and the decoder files and sample set are recorded in version control for future upgrades and regression testing.
How a raw application log becomes fields a rule can match
The diagram starts at the application, which writes a log line to a file or syslog. A Wazuh agent or a syslog source forwards that line to the Wazuh server, where pre-decoding, the parent decoder and the child decoder split it into named fields. The rule engine then matches on those fields, and alerts are stored in the Wazuh indexer and shown in the Wazuh dashboard. The custom decoder files are the part your team writes and maintains, so check the parent and child match before anything else.
Your team writes and maintains the custom decoder files on the Wazuh server.
Security and data handling risks in custom decoding
A custom decoder touches sensitive data, the server that runs it and the process that maintains it. The cards below cover the places where decoding work most often creates exposure: what gets stored, who can change the files, how format drift goes unnoticed and what happens to sample logs.
Secrets and personal data in stored alerts
A decoder extracts fields from a log, and anything it captures can end up in alerts stored in the Wazuh indexer. Application logs often carry session tokens, API keys, email addresses, account numbers or health identifiers. Before writing a decoder, list the fields the application emits and decide which ones analysts need. Capture only those, and use the rule and decoder design to drop or mask the rest. Ask the application owner which fields are sensitive and confirm who can query the indexer.
Silent drift after log format changes
A decoder can stop matching without any error. When an application team adds a field, renames a key or changes a timestamp format, the decoder may simply fail to match and the rules that depend on it go quiet. Nothing in the pipeline reports that the events are no longer decoded. Build a regression set of sample lines for each log version, and schedule a check that counts decoded events per source. Ask application teams to notify the security team before logging changes ship.
Decoder files edited outside version control
Decoder files changed directly on the server leave no review record and can be overwritten during an upgrade or a configuration push. A quick edit made during an incident may stay in place for months with no owner. Keep every decoder in a repository with reviewed changes, and deploy from that repository only. Ask who approves a decoder change, how a rollback works and how the team confirms that the deployed file matches the committed version.
Access control on the decoder directory
Decoder and rule files are read by the Wazuh server and can change what it accepts or hides. Whoever can write to the custom decoder directory can suppress events from a system they want to hide. Restrict write access on the server to the service account and a small administrator group, and log changes to that directory. Review which accounts hold administrator access to the Wazuh server, since they can also edit these files. Confirm the exact directory path and permissions against the documentation for your version.
Production samples in the repository
Sample logs are the fastest way to test a decoder, and they are also the most likely place for real secrets and personal data to enter a repository that many people can read. Scrub samples before they are committed: replace tokens, customer identifiers and addresses with consistent placeholders that keep the field shape intact. Set a rule that raw production logs never leave the production environment. Ask who performs the scrub and how the team checks the repository for leaked values.
Maintaining decoders across application releases and upgrades
The application team controls the log format, so it is the first place a decoder breaks. A renamed field, a new separator, a changed timestamp format or a log line that gains a field can stop a parent or child decoder from matching, and the event then reaches Wazuh with no extracted fields. Treat log format as an interface with a version, and agree in advance that format changes go to the security team before release.
- Change notice: Require a short description of any change to log lines, including new event types, renamed keys and changed delimiters, before the release reaches production.
- Sample capture: Keep a set of representative log lines from each event type, including error and edge cases, in version control next to the release.
- Staging logs: Ask for logs from a pre-production build so the decoder can be checked against real output rather than the documented format.
- Logging library changes: Flag framework or logging library upgrades, since they can alter default formats even when the application code is unchanged.
- Retest scope: Any change that alters a decoded field, prefix or timestamp needs a full decoder test run, while cosmetic message text changes usually need only a spot check.
Check that the application team knows the decoder exists and that its change process includes a named contact on the security side.
The security team owns the rules that depend on decoded fields, so it must confirm that every field a rule uses still exists and still has the same meaning after a change. A decoder can keep matching while a field moves to a different name, which causes rules to fire less often or not at all. Testing the decoder alone is not enough, because the question is whether the expected rule still fires.
- Field inventory: Keep a list of every decoded field used by custom rules, with the rule IDs that depend on it, so a change to one field shows its impact immediately.
- Expected-alert tests: Maintain sample logs that should trigger specific rules, and run them through wazuh-logtest after each decoder or application change.
- Rule ID review: Confirm that rule IDs and levels still match what dashboards, CDB lists and reports reference after a decoder update.
- Negative samples: Include logs that should not match, so an overly broad change in the decoder does not start producing noise.
- Change record: Record each decoder revision with its date, the application version it supports and the test results, so later reviews can trace a missed alert to a specific change.
Confirm with the team which logs feed compliance or incident response use cases, since those decoders need the strictest retest.
The platform team upgrades the Wazuh server and agents, and it needs to know which custom decoder files are preserved and which are replaced by a package upgrade. Custom decoders are normally kept in local configuration rather than the default decoder files, which helps them survive upgrades, but the exact paths and upgrade behavior depend on the version in use. Confirm the file locations against the upgrade documentation for your version before the first upgrade, not after.
- Local file location: Confirm in the upgrade documentation for your version where custom decoder files must sit so package upgrades do not overwrite them.
- Pre-upgrade test: Run the full decoder and rule test set on a staging cluster built from the target version before upgrading production.
- Backup first: Back up the custom decoder and rule files, along with the server configuration, before each upgrade.
- Agent and server order: Check whether any decoder change depends on a specific server version, and sequence upgrades so the server handles the logs before agents send new formats.
- Post-upgrade check: After the upgrade, confirm that the decoders load without errors in the server logs and that a sample event from each source still produces the expected fields.
Ask the Wazuh support or documentation for your version to confirm any file path, since default locations change between release lines.
Limits to confirm for your Wazuh version and log sources
The decoder work in this topic depends on details that change between Wazuh releases and between log sources. The cards below list what to check against the documentation for your exact version, the patch release you plan to run, and the device or application that produces the logs.
Decoder syntax in the 4.14 line
Confirm the exact decoder XML elements, attribute names and regular expression dialect supported in the Wazuh 4.14 line you run, rather than relying on examples from older documentation or forum posts. Check how prematch, regex and order behave together, and which <decoder> attributes are valid for parent and child decoders. Test each construct on a lab server before it reaches production, because a malformed decoder can fail quietly and leave events undecoded.
Behavior changes in patch releases
Read the release notes for each 4.14 patch you plan to run, including 4.14.8 and 4.14.9, and note any change to decoding, regex handling or default decoder files. Pin the patch version used for testing and the version in production so that a decoder that matched in the lab still matches after an upgrade. Ask your Wazuh contact or read the notes to confirm whether 4.14.9 changed decoding behavior at all, since this topic does not assume it did.
Server load from broad regexes
Every event passes through decoder matching on the Wazuh server, so many broad regular expressions with loose prematch conditions can add processing cost as log volume grows. Ask how decoder evaluation scales in your deployment size, and measure the server under a realistic log replay before adding decoders for high-volume sources. Narrow prematch strings reduce the number of expensive regex attempts, and a cluster or a larger server may be needed if the measurement shows sustained pressure.
Agent or agentless collection
Decide whether the device or application needs a Wazuh agent or agentless collection through syslog or periodic API probing. Agents can read local files and report with more context, while agentless sources depend on what the device sends over the network. Confirm with the vendor and the Wazuh components documentation which method suits the source, because the choice determines where the decoder sits and how logs reach the server.
Wazuh componentsFields the source never logs
A decoder can only extract fields that the application or device writes to its log. If a user identifier, source address, outcome or request path is missing from the message, no regex can recover it later, and rules that depend on that field will never fire. Review sample log lines from production with the application owner before designing the decoder, and ask the vendor or development team to add the missing fields to logging when they are needed for detection.
Questions teams ask before writing Wazuh decoders
How much effort does a Wazuh decoder for one application take?
The effort depends mostly on how varied the log output is, not on how many lines it has. A decoder for one application with a single, stable line format can be a small piece of work, while an application that writes several formats, nested messages and multi-line stack traces needs more analysis and more test cases. The main drivers are the number of distinct event types, the number of fields a rule needs to read, whether the format changes between versions, and how many log sources feed the same decoder. Ask any provider to break the estimate down by event type and by field, because that breakdown shows where the time goes and what you can drop if the budget is tight.
Can an in-house engineer write a Wazuh decoder without Wazuh specialists?
Yes, a engineer who is comfortable with regular expressions, log formats and the Wazuh ruleset can write a first decoder, and many teams do. What usually takes longer is knowing how the three decoding phases interact, how parent and child decoders match, and how a rule later depends on the field names a decoder creates. A useful test is whether the engineer can explain why a sample log matches or fails, using the output of the test tools, and can name the rule that should fire. If that is not yet true, a short working session with an experienced practitioner often saves more time than a full outsourced build.
What inputs does a decoder project need from our team?
A decoder project needs representative logs, documentation of the log format and a safe place to test. Ask for a sample of every event type you want to detect, including errors, edge cases and the lines that look unusual, because a decoder built only from happy-path samples will fail in production. Also provide the logging configuration that produces the output, the application version, and any documentation the vendor or internal team has published about fields. Finally, you need a test environment with a Wazuh server or access to the logtest tooling, and an agreed way to send live events to a non-production agent so the decoder is tested under real conditions.
How long does validating a first custom decoder take?
Validation time varies with the sample set and with how many review cycles the team needs, so no general duration can be stated here. The work usually runs in stages: writing the decoder against samples, testing each sample in logtest, confirming that the rules which depend on it fire, and then running it against live traffic for a period that the security team agrees on. Each stage can reveal missing samples that send the work back. Ask the provider for a schedule with named checkpoints and for the number of sample cycles included, and ask your own team to confirm when log samples and a test host will be available, since those dependencies often set the pace.
Do custom decoders break when we upgrade Wazuh?
Custom decoders are stored in their own files and are normally not overwritten by an upgrade, but an upgrade can still change behavior. Default decoders and rules can change between releases, and a custom decoder that relies on a parent decoder, a field name or a rule that was modified upstream may stop matching. Keep decoders in version control, name files clearly, avoid editing default files, and rerun your logtest samples after every upgrade in a staging environment before production. Check the release notes for the Wazuh version you are moving to, and confirm with your provider whether upgrade regression testing is part of the scope or a recurring service.
Which logs need decoders, and which can use the JSON decoder?
If an application already writes structured JSON, the built-in JSON handling is often enough, and a custom decoder is needed only for fields that the JSON decoder does not expose in the form your rules expect. Plain text, key-value formats with inconsistent separators, and syslog-style messages with embedded data usually need a custom decoder. Review a sample of each log type before deciding. Teams that skip this step often build a full decoder for logs that only needed a configuration change, so the first deliverable of any scoped project should be an inventory of log formats with a recommendation for each.
What should a partner quote for decoder work include?
A quote should state the written scope in terms you can check: the list of applications and log sources, the event types in scope, the fields each rule must read, the target Wazuh version and deployment, and the environment where testing happens. It should also list the deliverables, such as decoder and rule files, sample logs with expected outputs, test results from logtest or the CI harness, and documentation for operators. Ask which items are one-time work and which recur, for example regression testing after upgrades or new event types. Finally, confirm what you must provide, how changes to scope are priced, and who owns the files at the end of the engagement.
How DeployOpen scopes Wazuh decoder work
DeployOpen starts decoder work with a written scope that lists each log source, the event types to cover, the fields to extract and the test set that proves the decoders work. For an in-house application, the log source list usually names the service, the log file or syslog stream, and the owner who can confirm the format. For an unsupported device, it names the firmware or software version that produced the sample. The event type list separates logins, configuration changes, errors and other messages, because each one needs its own parent and child decoder and its own rule path. The field list states which values rules will read, such as the source user, the source address, the action and the outcome, so that the decoder work stops at the fields the detections need. Before any build starts, the client should confirm that they can supply real sample logs for every event type, including malformed and rare messages, since the test set is only as good as the samples in it.
Delivery is tied to evidence rather than to the decoder files alone. Each decoder is run through wazuh-logtest against the agreed sample set, and the output for each sample, covering the pre-decoding result, the decoder that matched and the extracted fields, is kept with the delivered files. Where a rule depends on a field, the test set also shows which rule fires, so the client can see that the chain works from log line to alert. The client should ask for this evidence in the quote and check it against the scope before accepting the work. Handover documentation covers the decoder and rule file locations, the naming conventions, the sample set and how to rerun the tests, so the client's own team can extend the work without the original builders. Log formats change when applications are updated, so DeployOpen also offers an optional retainer that covers reviewing format changes, updating decoders and rerunning the test set. Clients should decide early whether that support will sit with their own team, a partner, or a retainer, and write the answer into the scope.

