Transforming raw telemetry into meaningful security intelligence through intelligent filtering, contextual enrichment and source-level optimization.
Introduction
Collecting logs is the easy part. Deciding what’s worth keeping is the hard part.
Forward every event from every device to your SIEM, and you pay for it twice: once in ingestion and licensing costs, and again in the analyst hours spent separating noise from meaningful security events.
Modern enterprise environments generate millions of events across endpoints, servers, applications, network devices and cloud infrastructure. However, not every event requires immediate investigation.
This is where NXLog Agent provides significant operational value.
By filtering and enriching telemetry at the source, organizations can deliver structured, relevant and contextualized data to their SIEM, monitoring platform or analytics engine.
In this blog, we’ll explore how to implement intelligent log filtering, event enrichment, data normalization and source-level optimization using NXLog Agent.
🎯 Why Log Filtering Matters
Not every event generated by a system contributes equally to operational visibility or security investigations.
Consider a Windows server generating:
- Successful logon events
- Failed authentication attempts
- Service state changes
- Application information messages
- Debug logs
- Scheduled task updates
Forwarding every event without a defined logging strategy can increase ingestion costs, storage requirements and the time analysts spend identifying meaningful activity.
However, indiscriminately removing events can also create security blind spots.
The objective should be simple:
Collect broadly when necessary, but forward intelligently.
Understanding Log Noise
Every organization has a different logging profile. Some environments generate millions of events every day, while only a small percentage require immediate investigation.
An effective telemetry strategy should prioritize:
- Security-relevant events
- Compliance-required records
- Authentication activity
- Administrative changes
- Firewall activity
- System and application errors
- Events required for forensic investigations
A well-designed telemetry pipeline prioritizes quality over quantity without compromising detection coverage or regulatory requirements.
Figure 1: NXLog Agent filtering and enrichment architecture.
Step 1: Filter Events by Severity
NXLog Agent allows filtering directly within the processing pipeline before data leaves the endpoint.
One straightforward approach is to implement filtering logic using an Exec directive within the input module itself.
Example: Drop Informational Events
<Input eventlog>
Module im_msvistalog
Exec if defined($SeverityValue) and $SeverityValue < 3 drop();
</Input>
This configuration discards events with a defined severity value below WARNING. Events without a defined severity value remain unaffected.
Benefits
- Reduced SIEM ingestion volume
- Lower storage requirements
- Reduced unnecessary network traffic
- Improved search efficiency
- Better utilization of security monitoring resources
Important: Once an event is discarded using drop(), subsequent stages of that processing path cannot recover it.
Know Your Severity Mapping Before Filtering
The im_msvistalog module normalizes Windows Event Log severity into the $SeverityValue field.
Know Your Severity Mapping
Windows Security audit events require special attention.
An Audit Failure event normalizes to ERROR and survives the severity filter above. However, an Audit Success event normalizes to INFO and is discarded.
Important security activities, including account lockouts, successful authentication and privileged account changes, may be recorded as Audit Success events.
A severity filter that appears harmless could therefore discard events required for threat detection and incident investigation.
SOC recommendation: For Windows Security monitoring, prioritize Event ID, channel and provider-based filtering instead of relying exclusively on severity.
Step 2: Filter Specific Security Events
Organizations often need to collect specific events for dedicated security monitoring use cases.
For example, Windows Event ID 4625 represents a failed logon attempt.
Example: Forward Failed Logon Events Only
<Input eventlog>
Module im_msvistalog
Exec if not ( defined($EventID) and
$EventID == 4625 and
$Channel == "Security" ) drop();
</Input>
This configuration retains failed logon events from the Windows Security channel while discarding other events from this dedicated collection path.
Two details are important when implementing this configuration:
Event source validation: Event IDs are not globally unique across all providers. Combining Event ID with the relevant channel or provider helps ensure accurate filtering.
Missing-field handling: Checking defined() before comparing a field helps prevent unexpected behavior when an event does not contain the required field.
Common Windows Security Monitoring Use Cases
Use Cases for Windows Monitoring
These events can support dedicated SOC detection pipelines based on organizational security requirements.
The objective is not to remove every other event from the organization, but to build purpose-specific telemetry streams while preserving other required records.
Step 3: Filter High-Value Accounts
Privileged accounts and service accounts often require additional monitoring because of their elevated access to critical infrastructure.
NXLog Agent can filter events based on specific account names.
Example: Monitor Privileged Users
<Input eventlog>
Module im_msvistalog
Exec if not ( defined($AccountName) and
lc($AccountName) IN ("administrator",
"admin",
"svc_backup") ) drop();
</Input>
This configuration retains events only when the specified account field exists and matches one of the configured account names.
The lc() function converts the account name to lowercase before comparison. This ensures that values such as Administrator and administrator are treated consistently.
The configuration also follows a fail-closed approach for this dedicated stream: an event without the required account field does not satisfy the selection criteria.
Important Configuration Consideration
Depending on the Windows event type, the relevant account name may be available through different fields:
Configuration Consideration
Always inspect actual collected events and validate the available field names before implementing production filtering rules.
A privileged account monitoring strategy should also account for domain administrators, application service accounts, emergency access accounts and other sensitive identities defined by the organization.
Step 4: Enrich Events with Environment Information
Filtering removes unnecessary data. Enrichment adds meaningful context.
A raw security event may tell an analyst that an authentication attempt failed, but it may not immediately explain whether the affected system belongs to a production, development or disaster recovery environment.
NXLog Agent can add this information directly to the event record.
Example: Add Environment Information
<Input eventlog>
Module im_msvistalog
Exec $Environment = "Production";
</Input>
This configuration adds an Environment field to the internal NXLog event record.
Common environment classifications include:
classifications
Adding this metadata before forwarding allows downstream security and monitoring platforms to identify the environment without requiring additional lookups.
For SOC teams, this can support more informed incident prioritization and response decisions.
Step 5: Add Business Context
Security teams investigate systems, applications and business risks — not just IP addresses.
Adding business metadata helps analysts understand the potential impact of a security event.
Example: Add Business and Ownership Information
<Input eventlog>
Module im_msvistalog
<Exec>
$BusinessUnit = "Finance";
$AssetOwner = "Security Team";
</Exec>
</Input>
This configuration enriches each event with business ownership information.
Organizations can extend this approach by adding metadata such as:
- Business unit
- Asset owner
- Application name
- Asset criticality
- Geographic location
- Compliance scope
- Infrastructure classification
Raw Event vs. Enriched Event
Consider the following illustrative failed logon event.
Before Enrichment
{
"EventID": 4625,
"Hostname": "Server01"
}
After Enrichment
{
"EventID": 4625,
"Hostname": "Server01",
"Environment": "Production",
"BusinessUnit": "Finance",
"AssetOwner": "Security Team"
}
The enriched event provides additional context that can help an analyst identify the affected business function and responsible team.
Technical consideration: Assigning values through Exec adds fields to NXLog's internal event record. To include those fields in a generic JSON output, serialize the event using to_json(); in the output module. Destination-specific modules may perform their own serialization.
Enrichment values should also be validated against the organization’s asset inventory or configuration management database to prevent incorrect ownership information from affecting incident response.
Step 6: Normalize Data for Consistency
Different systems generate telemetry in different formats.
The im_msvistalog module reads the Windows Event Log API directly and provides structured event fields, including $EventID and $Channel.
Raw event XML can also be captured by explicitly enabling the CaptureEventXML directive, which is disabled by default.
Other sources, such as application logs or vendor-specific text formats, may require additional parsing.
Example: Parsing JSON from an Application Source
<Extension json>
Module xm_json
</Extension>
<Input appjson>
Module im_file
File "/var/log/myapp/events.json"
Exec parse_json();
</Input>
The xm_json extension provides the parse_json() procedure, which converts JSON stored in $raw_event into structured NXLog event fields.
This example assumes the application writes one valid JSON event per input record.
Parsing vs. Normalization
Although closely related, parsing and normalization serve different purposes.
Organizations should align their normalization strategy with the schema expected by their destination platform, such as:
- Elastic Common Schema (ECS)
- Unified Data Model (UDM)
- Open Cybersecurity Schema Framework (OCSF)
- Organization-specific event schemas
Consistent normalization improves searching, correlation, dashboard development and detection engineering.
Step 7: Build the Complete Processing Pipeline
Now that we’ve explored filtering, enrichment and normalization, let’s combine these capabilities into a practical Windows Security monitoring pipeline.
Instead of collecting every Windows event and subsequently discarding unwanted records, we can push the Event ID selection directly into the Windows Event Log subscription using QueryXML.
Complete NXLog Configuration Example
<Extension json>
Module xm_json
</Extension>
<Input windows_events>
Module im_msvistalog
<QueryXML>
<QueryList>
<Query Id="0">
<Select Path="Security">*[System[(EventID=4625)]]</Select>
</Query>
</QueryList>
</QueryXML>
<Exec>
$Environment = "Production";
$BusinessUnit = "Finance";
$AssetOwner = "Security Team";
</Exec>
</Input>
<Output siem>
Module om_tcp
Host 10.0.0.10
Port 1514
Exec to_json();
</Output>
<Route security_pipeline>
Path windows_events => siem
</Route>
What Does This Pipeline Do?
- Subscribes to the Windows Security Event Log.
- Selects Event ID 4625 directly at the subscription level.
- Collects the selected failed logon events.
- Adds environment information.
- Adds business ownership information.
- Serializes the enriched events into JSON.
- Forwards the events to the configured SIEM destination.
Filter Earlier Than the Agent
The most important architectural improvement in this configuration is the use of QueryXML.
Rather than collecting unwanted events and dropping them later, the selection takes place within the Windows Event Log subscription itself.
This means events outside the query criteria are not handed to NXLog Agent through this subscription.
Figure 2: Comparing agent-level filtering with Windows Event Log subscription-level filtering.
Source-level filtering can reduce unnecessary processing and improve collection efficiency. Use Exec filtering when the required selection criteria cannot be expressed through the Windows Event Log query.
Production Deployment Consideration
The configuration above uses om_tcp to demonstrate generic TCP-based forwarding.
TCP alone does not provide encryption.
For production environments, organizations should implement TLS-encrypted transport or appropriate destination-specific output modules with secure authentication and certificate validation.
Also, the IP address, port and enrichment values used in this configuration are illustrative and should be replaced with actual environment-specific values.
Where Can the Enriched Event Go Next?
One of the strengths of NXLog’s modular architecture is its ability to deliver telemetry to different security, monitoring and analytics destinations.
NXLog provides generic output modules as well as specialized integrations designed for specific platforms.
Figure 3: NXLog destination-specific telemetry integration architecture.
Destination-specific output modules help simplify integration by handling communication and formatting requirements.
However, additional authentication, field mapping, configuration or telemetry transformation may be required depending on the destination.
For example, Prometheus primarily consumes metrics rather than arbitrary security event logs. Failed logon events would need to be transformed into suitable metrics before being exposed to Prometheus.
Module availability may also depend on the NXLog Agent version and subscription plan.
🏢 Practical Enterprise Scenario: Optimizing SOC Telemetry
Imagine an organization managing:
- 500 endpoints
- 25 Windows servers
- Linux application servers
- Firewalls and network devices
- Cloud workloads
- Centralized SIEM infrastructure
Without a defined filtering and enrichment strategy, the organization may experience unnecessary ingestion, inconsistent event formats and limited business context.
By implementing NXLog Agent filtering and enrichment, the organization can establish purpose-specific telemetry pipelines while preserving required security and compliance records.
Illustrative SIEM Ingestion Optimization
Consider a hypothetical organization forwarding 100 GB of telemetry to its SIEM every day.
After implementing validated filtering policies, assume its daily SIEM ingestion is reduced to 60Â GB.
Actual reductions and financial savings depend on the organization’s log sources, event volumes, retention requirements, filtering policies and SIEM licensing model.
Insert the corrected generated Image 3 here, without unsupported percentage statistics.
Security and Compliance Considerations
While filtering can optimize telemetry volume, organizations must ensure that it does not introduce security monitoring or compliance gaps.
Before implementing filtering policies, consider the following:
Organizations operating in regulated sectors should validate their logging strategy against applicable requirements, including ISO/IEC 27001, PCI DSS, CERT-In directions, RBI requirements and SEBI CSCRF, wherever relevant.
Filtering should support compliance objectives — not replace mandatory log collection and retention requirements.
Best Practices for Intelligent Telemetry Management
1. Filter as close to the source as possible
Where the source supports native filtering, such as Windows Event Log subscriptions, use it to avoid unnecessary collection.
2. Preserve security-critical events
Do not rely exclusively on severity. Validate Event IDs, providers, channels and detection dependencies.
3. Validate field names before filtering
Use defined() where appropriate and inspect actual event records before implementing production rules.
4. Enrich before forwarding
Add environment, business ownership and asset criticality information using verified inventory data.
5. Normalize data consistently
Align event structures with the schema required by the destination platform.
6. Implement secure telemetry delivery
Use TLS encryption, appropriate authentication and certificate validation.
7. Monitor pipeline health
Track agent availability, event volumes, ingestion latency, dropped events and output failures.
8. Maintain version-controlled configurations
Document filtering logic, configuration changes, approvals and rollback procedures.
9. Test before production deployment
Validate new filtering rules in a staging environment and confirm that existing detection use cases continue to function.
10. Review filtering policies periodically
Business requirements, infrastructure, regulatory obligations and threat landscapes evolve. Your telemetry strategy should evolve with them.
Final Thoughts
A telemetry pipeline isn’t measured by how much it collects. It’s measured by how much of what it collects is worth reading.
Filtering close to the source reduces unnecessary noise. Enrichment adds the context — hostname, environment, owner and business unit — that turns a raw event into information an analyst can act on.
Together, these techniques can help organizations optimize SIEM ingestion, improve investigation efficiency and prevent meaningful security events from getting buried in excessive data.
Start small. Choose one noisy log source, implement a validated filtering strategy, measure the impact and expand gradually.
As your infrastructure and threat landscape evolve, revisit your filtering rules regularly to ensure they continue to meet operational, security and compliance requirements.
The future of effective log management isn’t about collecting more data. It’s about collecting better data, preserving what matters and delivering intelligence where it creates the most value.
What’s Next?
Stay tuned for the next blog in this NXLog series:
📊 Seeing the Bigger Picture: Integrating NXLog with SIEM, Monitoring & Observability Platforms
In the next article, we’ll explore how the filtered and enriched telemetry streams we’ve built can connect with modern SIEM, monitoring and observability platforms to support enterprise security operations.
Acknowledgement
A sincere thank you to NXLog and the entire NXLog team for their valuable technical guidance, constructive feedback and continuous support throughout this blog series.
Their recommendations regarding source-level filtering, Windows Event Log severity mapping, field validation, event enrichment and destination-specific integrations have helped improve the technical accuracy and practical value of this article.
By Amit Ambekar. Originally published on Medium.













