ASIM Parser Overview
Earn 25 points (50 with Pro) in two steps
- ① Read through the lesson — each section gets a ✓ as you scroll through it.
- ② When every section has a ✓, tap Complete lesson.
0 of 9 read · keep scrolling
✦ See fewer ads and earn double points — 50 a lesson instead of 25 — with Pro
Mastering Data Normalization: The ASIM Parser Overview in Microsoft Sentinel
Introduction: Why Data Normalization Matters in Security Operations
In the modern Security Operations Center (SOC), data is the lifeblood of every investigation. However, this data comes from a vast array of sources—firewalls, identity providers, cloud infrastructure, endpoint agents, and email gateways. Each of these vendors formats their logs differently. One vendor might label a source IP address as src_ip, while another uses source_address, and a third uses ClientIP. When you are trying to write a detection rule or perform a threat hunt across these disparate sources, the lack of a common schema becomes a major bottleneck.
This is where the Advanced SIEM Information Model (ASIM) comes into play. ASIM is a framework within Microsoft Sentinel that provides a standardized set of schemas and parsing mechanisms to normalize data at query time. Instead of writing separate queries for every single vendor log source, you write one query against a normalized schema, and ASIM takes care of mapping the raw data into that structure. This approach drastically reduces the complexity of security content development and ensures that your detection coverage remains consistent even when you add new data sources to your environment.
Understanding ASIM is not just about learning a new syntax; it is about adopting a philosophy of data-centric security. By normalizing your data, you enable your analysts to move faster, reduce the cognitive load of remembering vendor-specific field names, and build detections that are inherently portable across different technologies. In this lesson, we will explore the architecture of ASIM, how to leverage built-in parsers, and how to write your own custom parsers for non-standard data sources.
Not read yet
The Core Concepts of ASIM
To effectively work with ASIM, you must understand the two primary components: the Schema and the Parser. The schema defines the standard field names and formats for a specific category of telemetry—such as Network sessions, Authentication events, or Process creation. The parser is the Kusto Query Language (KQL) function that performs the actual transformation of raw, vendor-specific data into that standardized schema.
Understanding Schemas
Schemas act as the "contract" for your data. When you target the NetworkSession schema, you can expect certain fields to exist, such as SrcIpAddr, DstIpAddr, and NetworkProtocol. Regardless of whether the original log came from a Cisco firewall, a Palo Alto device, or an Azure NSG flow log, the output of an ASIM-compliant parser will present the data in this unified format. This consistency is what allows you to write a single detection rule for "Brute Force Attack" that works across every identity provider in your environment.
Understanding Parsers
Parsers are essentially KQL functions stored within your Sentinel workspace. When you call a parser, it executes a series of transformations—such as renaming columns, converting timestamps, or extracting values from JSON strings—to align the raw data with the target schema. ASIM utilizes a multi-layered approach to parsing, distinguishing between "Source-specific" parsers and "Union" parsers. This distinction ensures that queries remain performant by only processing the necessary tables.
Callout: Schema vs. Parser Think of the schema as a blueprint for a house and the parser as the construction crew. The blueprint (schema) dictates that every house must have a front door (a field named
SrcIpAddr). The construction crew (the parser) takes the raw materials (the logs) and ensures they are assembled into a structure that matches the blueprint, regardless of whether the raw materials are wood, brick, or steel.
Not read yet
Navigating the ASIM Ecosystem
Microsoft Sentinel provides a library of built-in ASIM parsers that cover most common security log sources. Before you attempt to write custom code, it is essential to know how to locate and utilize these existing resources.
Using Built-in Parsers
Built-in parsers follow a naming convention that makes them easy to identify. They typically start with im (which stands for "Information Model") followed by the schema name. For example, imNetworkSession is the primary parser for network logs. When you use these parsers, you are essentially querying a function that automatically unions all the relevant underlying tables for you.
To use a built-in parser, you simply call it like a table in your KQL query:
// Example: Querying normalized network data
imNetworkSession
| where TimeGenerated > ago(24h)
| where NetworkProtocol == "TCP"
| summarize count() by SrcIpAddr, DstIpAddr
The Difference Between Source-Specific and Unified Parsers
It is important to distinguish between the two types of parsers you might encounter:
- Source-Specific Parsers: These are designed for a specific vendor or product (e.g.,
imNetworkSessionCiscoASA). You use these when you want to target a specific data source for performance reasons or debugging. - Unified Parsers: These are the "master" functions (e.g.,
imNetworkSession) that automatically include all source-specific parsers for that schema. In most cases, you should use these to ensure your queries cover all your data sources.
Note: Always check the documentation for a specific parser to see if it supports "parameterized" filtering. Some parsers allow you to pass arguments like
eventresult='Failure'directly into the function call, which can significantly improve query performance by filtering the data before the union operation occurs.
Not read yet
Step-by-Step: Creating a Custom ASIM Parser
While Microsoft provides many built-in parsers, you will inevitably encounter proprietary or niche log sources that are not covered. Creating your own parser allows you to bring this data into the ASIM fold.
Step 1: Analyze the Raw Data
Before writing any code, you must understand the structure of your raw logs. Run a simple query to inspect the data:
MyCustomTable_CL
| take 10
Look for fields that map to the ASIM schema requirements. For example, if you are creating a NetworkSession parser, identify where the source IP, destination IP, and bytes transferred are stored.
Step 2: Write the Transformation Logic
Use the project or extend operators in KQL to rename fields and format values. ASIM requires specific data types—for example, timestamps must be in datetime format, and IP addresses should ideally be represented as strings that can be parsed by ipv4_is_in_range.
let parser = (
MyCustomTable_CL
| project
TimeGenerated = TimeStamp,
SrcIpAddr = Source_IP_Address,
DstIpAddr = Destination_IP_Address,
NetworkProtocol = Protocol,
EventVendor = "MyVendor",
EventProduct = "MyProduct",
EventSchema = "NetworkSession"
);
Step 3: Register the Function
Once your logic is sound, you must save it as a function in your Sentinel workspace. Navigate to the "Logs" blade, paste your query, and click "Save" -> "As function". Give it a name that follows the ASIM naming convention (e.g., imNetworkSessionMyVendor).
Step 4: Add to the Unified Parser
To make your new parser part of the global imNetworkSession union, you need to update the workspace-level "ASIM Configuration" or simply ensure your custom parser is registered within the function alias. Once registered, queries calling imNetworkSession will automatically include your data.
Not read yet
Best Practices for ASIM Implementation
Implementing ASIM is a long-term strategy, not a one-time project. Follow these best practices to ensure your normalized environment remains maintainable and performant.
1. Prioritize High-Volume Data
Focus your normalization efforts on your highest-volume logs first. Normalizing your firewall, proxy, and identity logs provides the most significant return on investment because these sources are queried most frequently for threat hunting and detection.
2. Maintain Schema Compliance
Always refer to the official ASIM schema documentation. Do not invent your own field names if a standard field exists. If you map Source_IP to SrcIpAddr, keep doing that consistently across all your parsers. If you deviate, you break the promise of the schema, and your detections will fail to see the data.
3. Leverage "Alias" Fields
ASIM often includes "alias" fields. For example, SrcIpAddr is the primary field, but SourceAddress might be provided as an alias. Use these aliases when writing generic queries to ensure maximum compatibility.
4. Monitor Parser Performance
Normalization happens at query time, which means complex parsers can impact the speed of your queries. Keep your transformations lean. Avoid heavy regex operations if possible, and prefer simple project or extend operations.
Warning: The Performance Trap Be careful with complex string manipulation inside your parsers. If you use
extract()orparse()on every single row of a high-volume log table, your dashboard and alert queries will slow down significantly. Always test your parser performance on a large dataset before finalizing it.
Not read yet
Common Pitfalls and How to Avoid Them
Even experienced security engineers fall into common traps when working with ASIM. Being aware of these will save you hours of debugging.
The "Missing Field" Error
The most common issue is a mismatch between the schema requirement and the data provided. If your parser outputs a string where the schema expects an integer, the query might fail or return null values. Always validate the data type of every field in your parser.
Over-Parsing
Some engineers try to parse every single field in a log source. This is unnecessary and expensive. Only parse the fields that are actually required by the ASIM schema or that you specifically need for your detection rules. If a field is not used in any detection or hunt, leave it as is in the raw table.
Ignoring the EventSchema Field
Every ASIM parser must include an EventSchema field that specifies which schema the data is mapped to. This field is used by the union queries to filter which parsers to include. If you forget this, your data will not show up in the unified queries.
Failure to handle Nulls
Different log sources handle missing data differently. Some might provide an empty string, while others might provide null or a placeholder like "0.0.0.0". Ensure your parser logic explicitly handles these cases so that your detections do not trigger on "0.0.0.0" as a valid source IP.
Not read yet
Comparison: Raw Logs vs. Normalized Logs
To visualize the power of ASIM, consider the following table comparing a query against raw data versus a query against a normalized schema.
| Feature | Raw Log Query | ASIM Normalized Query |
|---|---|---|
| Field Names | Vendor-specific (src_ip, ClientIP, Source) |
Standardized (SrcIpAddr) |
| Query Complexity | High (Requires union of many tables) |
Low (Single function call) |
| Maintenance | High (Update every query for new logs) | Low (Update one parser) |
| Portability | None (Tied to specific vendor) | High (Works across all vendors) |
| Readability | Poor (Hard to understand for new analysts) | Excellent (Common naming convention) |
This comparison highlights why normalizing data is a fundamental shift in how you manage security operations. Instead of managing individual log sources, you manage the type of activity, regardless of what produced the log.
Advanced Topics: Extending ASIM
Once you have mastered basic normalization, you can start looking into more advanced techniques to make your SOC more effective.
Parameterized Parsers
You can create parsers that accept input parameters to filter data at the source. This is highly effective for reducing the amount of data processed during a query.
// Example of a parameterized parser
let imNetworkSession_Filtered = (
starttime:datetime=datetime(null),
endtime:datetime=datetime(null),
srcip:string="*"
) {
imNetworkSession
| where TimeGenerated between (coalesce(starttime, ago(1d)) .. coalesce(endtime, now()))
| where SrcIpAddr == srcip or srcip == "*"
};
Dealing with Nested JSON
Many modern cloud logs arrive as nested JSON objects. While KQL handles JSON well, doing this inside a parser can be slow. Use the evaluate bag_unpack() operator if you have a wide, dynamic JSON structure, but be cautious about the number of columns this creates, as it can lead to performance degradation.
Callout: The Value of Normalization The true value of ASIM is not just in the ease of writing queries—it is in the consistency of the output. When your analysts look at an incident, they see the same field names and the same data structure, whether the alert came from an on-premises firewall or a cloud-native identity service. This reduces the time spent on "data translation" during an investigation, allowing the analyst to focus purely on the threat.
Not read yet
Practical Example: A Unified Detection Rule
Let's look at how a detection rule changes when you move from raw logs to ASIM.
Without ASIM (Raw logs):
// This rule only works for Firewall A
FirewallA_Logs
| where action == "blocked"
| summarize count() by src_ip
| where count_ > 100
With ASIM (Normalized logs):
// This rule works for ALL firewalls in the environment
imNetworkSession
| where EventResult == "Failure"
| summarize count() by SrcIpAddr
| where count_ > 100
The difference is clear. With the ASIM version, you don't need to write a new rule when you add a new firewall vendor to your environment. You simply ensure your new logs are mapped to the imNetworkSession schema, and the existing detection rule automatically starts covering that new data source. This is the definition of "scale" in a modern SOC.
Troubleshooting ASIM Parsers
When a parser is not working as expected, follow this systematic troubleshooting approach:
- Check the Raw Data: Run a query on the raw table to ensure the data is actually arriving. If the data isn't there, the parser cannot process it.
- Test the Parser Logic: Copy the code from your function into a new query tab and run it against a small sample of data. This allows you to see the output columns and verify the transformations.
- Verify the
EventSchema: Ensure your parser correctly tags the data with theEventSchemafield. If this is missing or incorrect, the unified union queries will ignore your data. - Inspect Data Types: Use
getschemaon your output to check the types of your columns. If you are expectingdatetimebut gettingstring, the query will fail to filter correctly on time ranges. - Check for Schema Violations: Ensure your parser does not output extra columns that are not part of the standard schema, as this can sometimes cause issues with certain KQL operators.
Not read yet
Key Takeaways
As we conclude this lesson on ASIM, remember these core principles to guide your implementation and daily operations:
- Consistency is Key: The primary goal of ASIM is to provide a unified schema (
SrcIpAddr,DstIpAddr, etc.) that allows you to write one query to rule them all. - The Parser is the Bridge: Parsers act as the translator between proprietary vendor log formats and the standardized ASIM schema.
- Use Built-ins First: Always check the Microsoft-provided library of parsers before spending time writing your own. Most common vendors are already supported.
- Performance Matters: Because normalization happens at query time, keep your parser logic simple and avoid excessive string manipulation or regex on high-volume data sources.
- Scalability Through Normalization: By using ASIM, your detection rules become portable. Adding a new log source to your environment becomes a task of mapping, not a task of rewriting your entire detection library.
- Schema Compliance: Adhere strictly to the official ASIM schema documentation. Deviating from standard field names breaks the interoperability that ASIM is designed to provide.
- Lifecycle Management: Treat your custom parsers like code. Use version control if possible, document your mapping logic, and regularly review your parsers for performance and accuracy as your log sources evolve.
By mastering ASIM, you are positioning yourself to be a highly effective security engineer capable of building robust, scalable detection systems. The ability to normalize data is one of the most sought-after skills in the modern Sentinel environment, as it directly translates to faster incident response and more reliable threat detection. Start small, normalize your highest-volume logs first, and slowly expand your coverage as you build confidence in the framework.
Not read yet
Each section gets a ✓ as you scroll through it. Tap the button to jump to the next one.
- Investigate Security Incidents
- Investigate Security Incidents Quiz5q
- Manage Incidents in Defender Portal
- Manage Incidents in Defender Portal Quiz5q
- Investigate Alerts and Alert Queues
- Investigate Alerts and Alert Queues Quiz5q
- Automated Investigation and Response
- Automated Investigation and Response Quiz5q
Spend your points to unlock exam-style practice questions
Spend points to unlock SC-200 exam-style practice questions.
Practice for SC-200