Juniper SRX RT_FLOW Log Fields: SESSION_CREATE, CLOSE and DENY
Published
One syslog message per firewall session event on a Juniper SRX: RT_FLOW_SESSION_CREATE when a policy permits a session, RT_FLOW_SESSION_CLOSE with byte and packet counts when it ends, and RT_FLOW_SESSION_DENY when a policy denies it — each with the addresses and ports before and after NAT, the service, policy, zones, session ID, application and user.
Official documentation: Juniper: Configuring the SRX to send RT_FLOW messages (with example messages) · Juniper: Security flow sessions
Sample record
Jan 15 09:00:01 srx-fw-01 RT_FLOW: RT_FLOW_SESSION_CREATE: session created 203.0.113.10/52100->10.0.0.100/443 junos-https 203.0.113.10/52100->10.0.0.100/443 None None 6 allow-web untrust trust 10001 alice(N/A) ge-0/0/0.0 HTTPS UNKNOWN No
Jan 15 09:00:15 srx-fw-01 RT_FLOW: RT_FLOW_SESSION_CLOSE: session closed TCP FIN: 203.0.113.10/52100->10.0.0.100/443 junos-https 203.0.113.10/52100->10.0.0.100/443 None None 6 allow-web untrust trust 10001 12(4800) 10(9600) 14 HTTPS UNKNOWN alice(N/A) ge-0/0/0.0 No From the LogTriage parser test corpus — synthetic data, no real hosts or users.
Field reference
| Field | Type | Meaning | Why it matters for security |
|---|---|---|---|
| evente.g. RT_FLOW_SESSION_DENY | string | The message: RT_FLOW_SESSION_CREATE (a policy permitted a new session), RT_FLOW_SESSION_CLOSE (the session ended) or RT_FLOW_SESSION_DENY (a policy denied or rejected it). | DENY shows what was blocked; CREATE and CLOSE show what got through and how much moved. |
| reasone.g. TCP FIN | string | Why a session closed (TCP FIN, TCP RST, idle Timeout, response received…) or why one was denied (policy deny, for example). | Many RST or timeout closes from one source are scanning; long sessions closed by FIN carry real traffic. |
| source-addresse.g. 185.220.101.42 | IP address | The client address before NAT; source-port is its port. | The party to investigate for inbound denies. |
| destination-addresse.g. 10.0.0.50 | IP address | The server address before NAT; destination-port is the port asked for. | Denied attempts on 22, 3389 or 445 from the internet are scanning or guessing. |
| nat-source-addresse.g. 203.0.113.10 | IP address | The source address after NAT (the same as source-address when no source NAT rule applied); nat-destination-address likewise. | For outbound traffic, the public address the internet saw — what an abuse report will name. |
| service-namee.g. junos-ssh | string | The Junos application (service) the destination port and protocol matched, such as junos-https or junos-ssh. | Groups denies by service without memorising ports. |
| protocol-ide.g. 6 | number | The IP protocol number: 6 TCP, 17 UDP, 1 ICMP. In DENY messages it is followed by the ICMP type in parentheses. | ICMP sweeps and UDP probes show up with their own protocol numbers. |
| policy-namee.g. deny-all | string | The security policy that matched — the one that permitted or denied the session. | A deny logged by the catch-all policy is unexpected traffic; one logged by a named policy is traffic you chose to block. |
| source-zone-namee.g. untrust | string | The security zone the session arrived from; destination-zone-name is the zone it was going to. | untrust to trust is inbound from the internet; trust to untrust is outbound — the direction for beaconing. |
| session-id-32e.g. 10001 | number | The session ID, the same in a session's CREATE and CLOSE messages. | Join CREATE and CLOSE to get the duration and volume of one connection. |
| bytes-from-cliente.g. 4800 | number | In CLOSE messages, bytes sent by the client, with packets-from-client before it; bytes-from-server and packets-from-server for the other direction. | Large bytes-from-client on outbound sessions is upload — possible exfiltration. |
| elapsed-timee.g. 14 | seconds | In CLOSE messages, how long the session lasted. | Very long outbound sessions to one address are tunnels or command-and-control. |
| applicatione.g. HTTPS | string | The application AppID identified (UNKNOWN when AppSecure is not used or nothing was identified); nested-application refines it. | An application that does not match the port (SSH on 443) is evasion. |
| usernamee.g. alice | string | The user, with roles in parentheses, when user identification (integrated user firewall) is configured; N/A otherwise. | Attributes sessions to people when the address is shared. |
| packet-incoming-interfacee.g. ge-0/0/0.0 | string | The interface the first packet arrived on. | Separates internet-facing interfaces from internal ones when zones are broad. |
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
The SRX’s flow module writes an RT_FLOW message for session events of security policies that have logging enabled: RT_FLOW_SESSION_CREATE when a permitted session starts, RT_FLOW_SESSION_CLOSE when it ends, and RT_FLOW_SESSION_DENY when a policy denies or rejects it. Juniper’s example messages show the same events in both of the SRX’s formats: a brief line of values in a fixed order, and a structured-data form that names each value (source-address, nat-source-address, policy-name, session-id-32, bytes-from-client, elapsed-time). This page uses those names for the brief form’s positions. Newer Junos releases append fields such as the application, user and interface.
The firewall log answers three questions in an investigation: what was blocked, what got through, and how much moved. Denies alone show attempts; the CREATE and CLOSE pair for the same session ID shows a connection that worked and its size.
The malicious sample shows one outside address working through SSH, 8080, SNMP and telnet on three internal hosts within six minutes — all denied, two of them by the catch-all policy — and a second address denied on HTTPS by a policy for known-bad sources. Every line is a deny: the sample shows attempts, and the absence of a CREATE for those addresses is what says none got through.
Where to get it
- Policy logging.
set security policies from-zone untrust to-zone trust policy deny-all then log session-init;session-closefor CLOSE messages. - Stream mode.
set security log mode streamwithstream <name> host <collector>sends messages from the data plane straight to a collector;format sd-sysloggives the structured form. - Event mode. Messages go through the routing engine’s syslog to a file (for example
match RT_FLOW_SESSION) or remote host. - Security Director / J-Web. Show the same events with filters.
# Denied sessions by source address and destination port
grep RT_FLOW_SESSION_DENY messages | sed -E 's/.*session denied ([^/]+)\/[0-9]+->[^/]+\/([0-9]+).*/\1 \2/' | sort | uniq -c | sort -rn | head
Parsing pitfalls
- Position matters in brief format. Fields shift between Junos releases; prefer the structured format for parsing.
- Three layouts. CREATE, CLOSE and DENY have different field orders; the reason comes first in CLOSE and last in DENY.
- Compound values.
address/port->address/port,packets(bytes)anduser(roles)hold two values each. - Two times. The syslog header and, in stream mode, the collector’s time can differ; the structured form carries its own timestamp.
- Drop-flow CREATE. Denied traffic can produce CREATE messages too; check the policy.
Detection ideas
- Scans: one source denied on many destination ports or addresses in minutes.
- Remote access exposure: permitted CREATE from untrust to trust on 22, 3389, 445 or database ports.
- Outbound to known-bad: sessions to addresses an inbound deny policy already blocks.
- Exfiltration: CLOSE with large bytes-from-client from internal hosts to external addresses.
- Long sessions: high elapsed-time outbound sessions to one destination.
The free browser analyzer reads SRX RT_FLOW messages and runs these checks locally.
Sending Juniper SRX to an LLM
One megabyte of this format is about 585,070 tokens on current Claude models and 391,115 on GPT models, measured with the models' own tokenizers — so a gigabyte sent raw to Claude Sonnet 5.5 costs about $1,170 in input tokens alone (prices of 2026-10-24). Estimate your own volume →
Frequently Asked Questions
- How do I log denied traffic on a Juniper SRX?
- Denied sessions are logged only when the policy that denies them has logging: add then log session-init to the deny policy (or the global default deny policy you create for it). Permitted traffic needs then log session-init for CREATE and session-close for CLOSE messages. The messages go to syslog streams or files set under security log or system syslog.
- What is the difference between the brief and structured RT_FLOW formats?
- In the standard (brief) format the values follow the message name in a fixed order, separated by spaces. In the structured-data format (security log format sd-syslog or structured-data) each value is a named key=value pair inside brackets, such as source-address and policy-name. The values are the same; only the brief form depends on position.
- Why do I see RT_FLOW_SESSION_CREATE for traffic that was denied?
- With a deny policy, the SRX can still create a short drop-flow session for the denied traffic, and Juniper notes that the RT log then shows RT_FLOW_SESSION_CREATE entries for dropped sessions. Check the policy-name: a CREATE matched by your deny policy is not permitted traffic.
- How do I find how much data a session transferred?
- Read the RT_FLOW_SESSION_CLOSE message with the same session-id-32: packets-from-client(bytes-from-client) and packets-from-server(bytes-from-server) give the volume in each direction and elapsed-time the duration in seconds. CREATE messages carry no counters.
Analyze a Juniper SRX 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]