Skip to main content
goliver
Staff
Staff
August 16, 2016

Technical Note: Debugging system scripting in FortiADC

  • April 24, 2026 at 11:59 AM
  • 0 replies
  • 2051 views
Description
This article provides an explanation on how to debug and find problems that are occurring in the scripting engine of the FortiADC.

Solution
There are several pre-defined scripts delivered with the FortiADC, these examples are documented and the explanation of the features are explained in the Appendix C of the FortiADC Handbook.

In the examples there is a use of the debug() command which has a printf format:
debug("uri %s matches sports|news|government\n", uri);
This command enables the printing of variables and text in the log so as to understand the flow of the code and decisions made by operators.

Log into the CLI of the FortiADC in order to see these logs:
#diag debug enable
#diag debug application haproxy scripting set
As the script is executed the text will appear on the terminal.

The scripting is mainly used as direct traffic according to anything related to http request or response, such as content routing.   

Thought Leadership. Security Summit. Thursday, November 12th, PGA National Resort, Palm Beach Gardens, FL.
Thought Leadership. Security Summit. Thursday, October 8th. Disney's Grand Californian Hotel & SPA, Anaheim, CA.
Security Operations Summit: Modernize SecOps. Operate AI-Native.AMER: November 4 | 9:00 AM PST. India and SAARC: November 5 | 10:00 AM IST. EMEA: November 5 | 10:30 AM CET. APAC: November 5 | 11:00 AM SGT