Cloud Network ✓ fields verified against sample logs

Azure NSG Flow Log Format: flowTuples Fields Explained

Published

JSON records per network security group, each with the rule that matched and a list of flowTuples — comma-separated lines giving time, source and destination address and port, protocol, direction, allow or deny, and in version 2 the flow state and packet and byte counts.

Official documentation: Microsoft: Flow logging for network security groups (log format) · Microsoft: Virtual network flow logs

Sample record

{
      "time": "2024-03-15T10:00:00.0000000Z",
      "systemId": "aaaabbbb-cccc-dddd-eeee-ffffaaaabbbb",
      "macAddress": "000D3AABCDEF",
      "category": "NetworkSecurityGroupFlowEvent",
      "resourceId": "/SUBSCRIPTIONS/00000000-0000-0000-0000-000000000000/RESOURCEGROUPS/CORP-RG/PROVIDERS/MICROSOFT.NETWORK/NETWORKSECURITYGROUPS/CORP-NSG",
      "operationName": "NetworkSecurityGroupFlowEvents",
      "properties": {
        "Version": 2,
        "flows": [
          {
            "rule": "UserRule_Allow_HTTPS_Inbound",
            "flows": [
              {
                "mac": "000D3AABCDEF",
                "flowTuples": [
                  "1710500000,203.0.113.10,10.1.0.5,50001,443,T,I,A,E,12,4800,8,3200",

From the LogTriage parser test corpus — synthetic data, no real hosts or users.

Explain this record field by field →

Field reference

Field Type Meaning Why it matters for security
timee.g. 2024-03-15T10:00:00.0000000Z date-time (UTC) Microsoft: "Time in UTC when the event was logged." Each flowTuple has its own time. The record time is when the batch was written; use each tuple's epoch time for the timeline.
categorye.g. NetworkSecurityGroupFlowEvent string Microsoft: "Category of the event. The category is always NetworkSecurityGroupFlowEvent." Identifies NSG flow records when they share storage or a workspace with other logs.
resourceIde.g. /SUBSCRIPTIONS/00000000-0000-0000-0000-000000000000/RESOURCEGROUPS/CORP-RG/PROVIDERS/MICROSOFT.NETWORK/NETWORKSECURITYGROUPS/CORP-NSG string Microsoft: "Resource ID of the network security group." Tells you which NSG — and so which subnet or NIC — the flows passed through.
properties.Versione.g. 2 number Microsoft: "Version number of the flow log's event schema." Version 2 adds flow state and traffic counts to each tuple. Version 1 tuples have no byte counts, so volume-based detections need version 2.
properties.flows.rulee.g. UserRule_Allow_HTTPS_Inbound string Microsoft: "Rule for which the flows are listed." Default rules appear as DefaultRule_…, your own rules as UserRule_…. DefaultRule_DenyAllInBound collects everything nothing else allowed — the scanning noise; flows under an allow rule are traffic that got in.
properties.flows.flows.mace.g. 000D3AABCDEF string Microsoft: "MAC address of the NIC for the VM where the flow was collected." Maps flows to a specific virtual machine's network interface.
properties.flows.flows.flowTuplese.g. 1710468001,185.220.101.45,10.0.0.4,54321,22,T,I,D,B,,,, list of strings Microsoft: comma-separated "Time stamp" (Unix epoch), "Source IP", "Destination IP", "Source port", "Destination port", "Protocol" (T or U), "Traffic flow" (I or O), "Traffic decision" (A or D), then in version 2 "Flow State" (B, C or E) and packets and bytes sent and received. Read position by position; I + A to ports such as 22, 3389 or 445 from the internet is exposure, O + A to an unknown address with large byte counts can be exfiltration.

Have one of your own records? Paste it into the log line explainer and each field is explained from this table, with times, codes and addresses decoded — in your browser.

What it records

NSG flow logs record the IP traffic that a network security group allowed or denied. Microsoft documents the log format: JSON records, each with the time, the NSG’s resourceId, and under properties.flows one entry per matching rule. Each rule lists the network interface (mac) and its flowTuples, comma-separated strings packing a whole flow into one line: time, source and destination address and port, protocol, direction and decision, and in version 2 the flow state and packet and byte counts.

The malicious sample has repeated inbound SSH attempts from one internet address, denied by the default rule; a burst of HTTPS connections from another address that the allow rule let through, with traffic counts; and denied attempts on port 4444, a common reverse-shell port.

Where to get it

  • Storage account. Flow logs are written as JSON blobs, one per hour, into a container named for the NSG flow log category; download them or read them with any blob client.
  • Traffic analytics. Network Watcher traffic analytics processes the logs into a Log Analytics workspace for querying.
  • Retirement. New NSG flow logs cannot be created; virtual network flow logs replace them with the same tuple idea in a different record shape. The analyzer reads both.
# Inbound flows allowed to SSH, RDP or SMB, from one downloaded blob
jq -r '.records[].properties.flows[] | .rule as $r | .flows[].flowTuples[] | "\($r),\(.)"' PT1H.json | awk -F, '$7=="T" && $8=="I" && $9=="A" && ($6==22 || $6==3389 || $6==445)'

Parsing pitfalls

  • Nested lists. Records → properties.flows[] (per rule) → flows[] (per NIC) → flowTuples[] (per flow); every level can repeat.
  • Positional tuples. The tuple has no names; version 1 has 8 fields, version 2 has 13 with empty counts on B records.
  • Epoch seconds. The tuple time is Unix seconds, separate from the record’s ISO time.
  • One flow, several tuples. A long connection appears as B, then C every five minutes, then E; sum counts over C and E, not B.
  • Where a flow is logged. Microsoft: the NSG that denies traffic logs it, and for allowed traffic “the last network security group that allows traffic logs the traffic to the flow logs.” Check both the subnet’s and the NIC’s NSG.

Detection ideas

  • Exposure: inbound allowed flows (I, A) to 22, 3389, 445 or database ports from internet addresses.
  • Scanning: many denied inbound flows from one source across ports or across destination addresses.
  • Outbound to odd ports: allowed outbound flows to 4444, 1337 or other reverse-shell ports.
  • Volume: outbound E or C tuples with large byte counts to addresses with no business reason — check them with the IP blocklist checker.

The free browser analyzer reads NSG and virtual network flow logs and runs these checks locally.

Sending Azure NSG Flow Logs to an LLM

One megabyte of this format is about 399,962 tokens on current Claude models and 278,398 on GPT models, measured with the models' own tokenizers — so a gigabyte sent raw to Claude Sonnet 5.5 costs about $800 in input tokens alone (prices of 2026-10-24). Estimate your own volume →

Frequently Asked Questions

What do the letters in an NSG flow tuple mean?
After the time, addresses and ports, Microsoft defines: protocol T (TCP) or U (UDP); traffic flow I (inbound) or O (outbound); traffic decision A (allowed) or D (denied). Version 2 adds the flow state — B when a flow begins, C while it continues and E when it ends — followed by packets and bytes in each direction.
Why do denied flows have no byte counts?
A denied flow never carries traffic, and a flow's Begin (B) record never has statistics either: Microsoft says statistics are provided for continuing (C) and ending (E) records, at five-minute intervals while the flow lasts. Only C and E tuples tell you how much data moved.
Are NSG flow logs being retired?
Yes. Microsoft states that NSG flow logs retire on September 30, 2027, and that new NSG flow logs can no longer be created; virtual network flow logs replace them. Existing records in storage are kept according to their retention policy, so investigations may still need to read this format for some time.
Which NSG logs a flow when traffic passes two NSGs?
Microsoft's flow log documentation says: "Deny rules are terminating. The network security group that's denying the traffic logs it in the flow logs." And: "Allow rules are non-terminating. If the network security group allows the traffic, processing continues to the next network security group. The last network security group that allows traffic logs the traffic to the flow logs." So look for a flow under the subnet's NSG and the NIC's NSG before concluding it is missing.

Analyze a Azure NSG Flow Logs file in your browser

The free analyzer detects this format, parses every field above and flags attack patterns — the file never leaves your machine. For threat-intel enrichment and an AI-written incident report, run it through LogTriage.

Investigating something right now? LogTriage checks every address in the file against threat intelligence and writes the incident report: 10 analyses a month free. The incident pack adds the in-depth AI analysis and files up to 100 MB: 25 analyses for $19, one payment, no subscription. Pricing

How this page was made. The official definitions, field names and examples on it are copied by script from the sources it links and re-checked against them on every build. The investigation advice was drafted with AI from those sources and passed a separate review before publishing. What is checked, and how · found a mistake? [email protected]