Contents

Debug Flow Parser

Turn FortiGate diagnose debug flow output into one readable card per packet trace: tuple, interfaces, session, route, policy, NAT, IPsec and the verdict, with every fact linked to its log line.

Sidebar group: Fortinet · Works offline: yes · Needs admin rights: no

When to use it

Quick start

  1. On the FortiGate, run a filtered flow trace. The Fortinet Command Builder Debug Flow tab builds the commands; keep Show function names on for best results.
  2. Generate the traffic, then copy the output, or log the session to a file.
  3. Paste the output into the box, or click Open file....
  4. Click Parse.
  5. Read the summary line of verdict counts.
  6. Click a trace header to open it. Click a line N link to jump to the event it came from.
  7. Use the verdict filter and search box to narrow a large capture.
  8. Use Export to save a report or add it to a project.

Inputs and options

Field What it means Default / accepted values
Text box diagnose debug flow output. Lines without trace_id= and msg= are ignored, so prompts and other output can stay in. Lines hard-wrapped by a terminal are joined back onto their record. Empty; up to 20 MB
Parse Parses the text.
Open file... Loads a .txt, .log or any text file (up to 20 MB) and parses it.
Verdict filter Show all verdicts, or only allowed, denied, dropped, existing session, or no verdict in log. all verdicts
Search Matches the tuple, interfaces, policy and any message text in a trace. Empty

Reading the results

Summary line. The number of traces, then counts per verdict: allowed, denied, dropped, existing session, no verdict. It also shows the number of unreadable trace lines (lines with trace_id= that could not be parsed) and a note if parsing stopped at 5,000 traces.

Trace header, one per trace_id, in the order they first appear:

Open trace. A facts table, notes, then the events.

If the input has exactly one trace, it opens automatically.

Worked example. Input (shortened):

id=65308 trace_id=12 func=print_pkt_detail line=5895 msg="vd-root:0 received a packet(proto=6, 192.0.2.10:51514->198.51.100.20:443) tun_id=0.0.0.0 from port2. flag [S], seq 1234567, ack 0, win 64240"
id=65308 trace_id=12 func=init_ip_session_common line=6076 msg="allocate a new session-0001a2b3, tun_id=0.0.0.0"
id=65308 trace_id=12 func=__vf_ip_route_input_rcu line=1990 msg="find a route: flag=00000000 gw-203.0.113.1 via wan1"
id=65308 trace_id=12 func=fw_forward_handler line=930 msg="Denied by forward policy check (policy 0)"

The trace shows denied, TCP 192.0.2.10:51514 > 198.51.100.20:443, port2 > wan1, Session new session 0001a2b3, Route gateway 203.0.113.1 via wan1, Verdict Denied: no policy matched (implicit deny, policy 0), with a note to check the policy's interfaces, addresses, services and schedule.

What the results do and do not tell you

Online activity and privacy

Nothing leaves this computer. Parsing is local. The pasted text is not saved by the app unless you export or add the result to a project. Debug output contains internal addresses and policy IDs; use Redacted... when sharing. See Export and redaction and Privacy.

Export and projects

When there are traces, the Export menu offers HTML, PDF, Markdown and plain text, Redacted..., and Add to project. The report contains a table of up to 200 traces (trace ID, packet tuple, interfaces, verdict, policy and line range), the note that verdicts are reported only where the log states them, and a detail section for the first 50 traces with their facts, notes and event lines. See Projects and notes.

Platform notes

No differences between macOS, Windows and Linux.

Troubleshooting

"No debug flow lines found (looking for lines with trace_id= and msg=)." The text is not debug flow output, or the trace_id= and msg= fields were lost when copying.

Many "unreadable trace lines". Lines contain trace_id= but no msg=, usually from damaged copying. Log the SSH session to a file and open that instead.

Tuple shows ? ? > ?. The received a packet line for that trace is missing; the output probably starts mid-trace.

Most traces show "no verdict in log". The trace count ran out, the output was cut off, or sessions were offloaded. Increase the trace count, or disable offload on the policy for the test.

Error "input larger than 20 MB" or "file larger than 20 MB". Split the log, or filter the flow trace more tightly.

Error "could not read : ...". The file could not be opened.