Fortinet white logo
Fortinet white logo

CLI Reference

diagnose server-load-balance persistence

diagnose server-load-balance persistence

Use this command to filter and display the persistence table (current sessions).

Syntax

diagnose server-load-balance persistence filter {'<option>'|show|clear}

diagnose server-load-balance persistence list

diagnose server-load-balance persistence clear {l4|l7-http}

filter

Create, show, or clear session list filters.

Use multiple commands to add filters to the filter list. For example, one command to add a source-ip filter and another to add a vs-name filter.

Put the filter expression in single quotes.

Filter options include:

  • source-ip — Single IP address or specify start and end addresses of a range.
  • source-port — Single port number or start and end port numbers of a range.
  • dest-ip — Single IP address or specify start and end addresses of a range.
  • dest-port — Single port number or start and end port numbers of a range.
  • vs-name — Specify a space-separated list of up to 8 virtual server configuration names.

Note: Only source IP and virtual server name filters are valid for L7 persistence clearing. Other fields are not present in the httproxy persistence table and will be ignored silently.

list

List matching sessions.

clear

Clear the list of matching sessions.

Clear options include:

  • l4 — l4 (lowercase "L" four) is the abbreviated form of Layer 4. Use the l4 option to clear the Layer 4 persistence table.
  • l7-http — l7 (lowercase "L" seven) is the abbreviated form of Layer 7. Use this option to the persistence table for virtual servers handled by the httproxy engine, including HTTP, HTTPS, TCPS, and RDP. This operation targets the Layer 7 persistence table specifically.
    To prevent unintended disruption, always define filters using diagnose server-load-balance persistence filter before executing the clear operation.
    This command removes matching entries from the Layer 7 persistence table. The most common use case is clearing Source Address–based persistence entries during testing or while troubleshooting client stickiness issues.
    Note: Passive Cookie and script-based persistence methods also share the same internal table but may not appear in CLI output. Use caution when clearing persistence in mixed configurations, as the operation affects all matching entries regardless of type.

Example

FortiADC-VM # diagnose server-load-balance persistence filter 'source-ip 10.1.1.1 10.1.1.100'

FortiADC-VM # diagnose server-load-balance persistence filter 'vs-name vs1 vs2'

FortiADC-VM # diagnose server-load-balance persistence filter show

filter=[flag:1000

source ip range: :: - :: port range: 0 - 0

dest ip range: :: - :: port range: 0 - 0

virtual server: vs1 vs2 ]

FortiADC-VM # diagnose server-load-balance persistence list

client-ip/port virtual-server-ip/port local-ip/port real-server-ip/port protocol service state in-bytes out-bytes expire virtual-server-name real-server-name

FortiADC-VM #

diagnose server-load-balance persistence

diagnose server-load-balance persistence

Use this command to filter and display the persistence table (current sessions).

Syntax

diagnose server-load-balance persistence filter {'<option>'|show|clear}

diagnose server-load-balance persistence list

diagnose server-load-balance persistence clear {l4|l7-http}

filter

Create, show, or clear session list filters.

Use multiple commands to add filters to the filter list. For example, one command to add a source-ip filter and another to add a vs-name filter.

Put the filter expression in single quotes.

Filter options include:

  • source-ip — Single IP address or specify start and end addresses of a range.
  • source-port — Single port number or start and end port numbers of a range.
  • dest-ip — Single IP address or specify start and end addresses of a range.
  • dest-port — Single port number or start and end port numbers of a range.
  • vs-name — Specify a space-separated list of up to 8 virtual server configuration names.

Note: Only source IP and virtual server name filters are valid for L7 persistence clearing. Other fields are not present in the httproxy persistence table and will be ignored silently.

list

List matching sessions.

clear

Clear the list of matching sessions.

Clear options include:

  • l4 — l4 (lowercase "L" four) is the abbreviated form of Layer 4. Use the l4 option to clear the Layer 4 persistence table.
  • l7-http — l7 (lowercase "L" seven) is the abbreviated form of Layer 7. Use this option to the persistence table for virtual servers handled by the httproxy engine, including HTTP, HTTPS, TCPS, and RDP. This operation targets the Layer 7 persistence table specifically.
    To prevent unintended disruption, always define filters using diagnose server-load-balance persistence filter before executing the clear operation.
    This command removes matching entries from the Layer 7 persistence table. The most common use case is clearing Source Address–based persistence entries during testing or while troubleshooting client stickiness issues.
    Note: Passive Cookie and script-based persistence methods also share the same internal table but may not appear in CLI output. Use caution when clearing persistence in mixed configurations, as the operation affects all matching entries regardless of type.

Example

FortiADC-VM # diagnose server-load-balance persistence filter 'source-ip 10.1.1.1 10.1.1.100'

FortiADC-VM # diagnose server-load-balance persistence filter 'vs-name vs1 vs2'

FortiADC-VM # diagnose server-load-balance persistence filter show

filter=[flag:1000

source ip range: :: - :: port range: 0 - 0

dest ip range: :: - :: port range: 0 - 0

virtual server: vs1 vs2 ]

FortiADC-VM # diagnose server-load-balance persistence list

client-ip/port virtual-server-ip/port local-ip/port real-server-ip/port protocol service state in-bytes out-bytes expire virtual-server-name real-server-name

FortiADC-VM #