Description
This article explains how to clear flash logs on all the APs which helps gather a fresh set of AP logs.
Scope:
FortiWLC.
Solution
The Access point’s flash logs may contain stale information which may not be necessary while troubleshooting. Often, they may confuse us with too many information if we are looking for a particular problem.
The command used to erase the flash log memory is:
ap> file areaerase logk0
ap> file areaerase logk1
The above commands have to be entered on the AP prompt. It is not feasible to enter the above commands on all the APs in a large network.
Follow the below procedure to clear the flash logs on all the APs connected to a controller.
Note:
All the APs have to be rebooted once for this to take effect.
Procedure:
file areaerase logk0
file areaerase logk1
For example, let’s name the file as 'clear-flash.scr'.
#cd ATS/scripts
#copy ftp://anonymous:anonymous@<FTP server ip address>/clear-flash.scr .
#copy tftp://<TFTP server ip address>/clear-flash.scr .
Fortiwlc(15)# configure terminal
Fortiwlc(15)(config)# boot-script clear-flash.scr
Fortiwlc(15)# configure terminal
Fortiwlc(15)(config)# no boot-script
To perform the above through the web Interface:
Step 1: Navigate to Maintenance -> AP Init Script -> New. Add any name (for example clear-flash) and enter the below commands, and select 'Save'.
file areaerase logk0
file areaerase logk1
Step 2: Mapping the script as a boot script in controller: Navigate to Configuration -> Devices -> Controller -> Under 'Default AP Init Script, add the newly created script name 'clear-flash.scr and select 'Save'. To take effect, reboot all the APs.
Step 3: Mapping it to required APs. If the script needs to be applied on all APs, map it in the controller and reboot the APs under Configuration -> Devices -> APs, select required APs or all APs,select Bulk Update', select the option 'AP-Init-script, enter the created script name 'clear-flash.scr' and select OK.
Fortiwlc(15)# conn ap 2
ap-2> flashcmds show all ==> The output should be empty
Note:
Mapping the script as a boot script will clear flash logs from all APs; when either the controller is rebooted or any of the APs is rebooted.
The script needs to be added only if the plan is to capture fresh logs for debugging and to be unmapped once testing is done.
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.