get : grep
In many cases the get and show (and diagnose) commands may produce a large amount of output. If you are looking for specific information in a large get or show command output you can use the grep command to filter the output to only display what you are looking for. The grep command is based on the standard UNIX grep, used for searching text output based on regular expressions.
Information about how to use grep and regular expressions is available from the Internet. For example, see
{get | show| diagnose} | grep <regular_expression>
Example output
Use the following command to display the MAC address of the FortiGate unit internal interface:
get hardware nic internal | grep Current_HWaddr
Current_HWaddr 00:09:0f:cb:c2:75
Use the following command to display all TCP sessions in the session list and include the session list line number in the output
get system session list | grep -n tcp
19:tcp 1110 -
27:tcp 3599 - -
38:tcp 3594 -
43:tcp 3582 -
Use the following command to display all lines in HTTP replacement message commands that contain URL (upper or lower case):
show system replacemsg http | grep -i url
set buffer "<HTML><BODY>The page you requested has been blocked because it contains a banned word. URL = %%PROTOCOL%%%%URL%%</BODY></HTML>"
config system replacemsg http "url-block"
set buffer "<HTML><BODY>The URL you requested has been blocked. URL = %%URL%%</BODY></HTML>"
config system replacemsg http "urlfilter-err"