FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
AnthonyH
Staff
Staff
Article Id 415083
Description This article describes one method of copying and pasting configuration that contain the special character '?' using batch mode.
Scope FortiGate.
Solution

By default, it is not possible to paste a question mark (?) in the CLI console. It will be removed after pasting.

 

For example: the URL 'https://api.hackertarget.com/aslookup/?q=AS215540' contains a question mark.

 

After pasting it, the question mark (?) is removed from the string, causing the threat feed to point to the wrong URL.

 

VM # config system external-resource

VM (external-resource) #     edit "LLP"

VM (LLP) #         set type domain

VM (LLP) #         set category 192

VM (LLP) #         set resource "https://api.hackertarget.com/aslookup/

VM (LLP) #         set resource "https://api.hackertarget.com/aslookup/q=AS215540"

VM (LLP) #         set refresh-rate 1440

VM (LLP) #     next

VM (external-resource) # end

 

To be able to paste URLs containing question mark in the CLI, it is necessary to do it in batch mode.

 

To start batch mode, run 'execute batch start'

 

To stop batch mode, run 'execute batch end'.

 

The following is an example to demonstrate the question mark (?) not being removed from the URL after pasting it in the CLI console.

 

VM # execute batch start 

Enter batch mode...

VM #
VM #
VM # config system external-resource

VM # edit "LLP"

VM # set uuid ab3de11c-a53b-51f0-1e96-b4727db19448

VM # set type domain

VM # set category 192

VM # set resource "https://api.hackertarget.com/aslookup/?q=AS215540"

VM # set refresh-rate 1440

VM # next

VM # end

VM # execute batch end

 

Exit and run batch commands...

 

VM # config system external-resource

VM (external-resource) # edit "LLP"

VM (LLP) # show

config system external-resource

    edit "LLP"

        set type domain

        set category 192

        set resource "https://api.hackertarget.com/aslookup/

        set resource "https://api.hackertarget.com/aslookup/q=AS215540"

        set refresh-rate 1440

    next

end


After the batch execution ends, the commands show as having successfully entered into the configuration.

For more information about batch mode, see Technical Tip: Bulk rule changes and example of the batch utility.