Skip to content
Smarter by Design.Simpler for Business

Smart Variables ​

What Is Smart Variables? ​

Smart Variables makes it possible to write into a field a value that is calculated while the request is being processed instead of a fixed value. For example, instead of writing a certain IP address into a tracking key, "the IP address of the client that makes the request" is selected; the value is calculated again at every request.

A variable is added to a field in three ways:

  • In the text fields the fx button on the right of the field (the tooltip Add variable) opens the Add variable window and the variable is selected from the list.
  • In the content editors (the content pages, the WAF blocking page) the button is not on the right of the field but in the toolbar of the editor and its name is Add TR7 variable. The button is present only in the Visual editor mode.
  • In the key lists there is no button: a new row is added with the first variable of the list and the variable is changed by clicking the label in the row. The same variable is not added to a list twice.

The variable text is also written or pasted into the field manually; a valid variable text turns into a label by itself after a short while.

190+
Variables
14 groups and one variable without a group
45+
Functions
They process and format the value
Context
The List
In every field only the variables suitable for there
fx
Access
The fx button in a text field, Add TR7 variable in the editor

The Add Variable Window ​

The window opens with the Add variable title while a new variable is being added and with the Edit variable title while an existing variable is being changed.

FieldWhat it is forHow it is filled
Variable nameIt lists the variables that can be used in that fieldThe list is in the form group name - variable name (e.g. Connection info - Client IP address); it is filtered by typing into the box
The argument fieldIt appears only in the variables that ask for additional informationIts label changes according to the variable selected: such as Header name, Cookie name, Table name and Format
Add functionsIn order to use the value not as it is but processedWhen it is opened, the Function 1 row comes with the To Base64 function; the rows added with start with JSON query and the $.key argument. Every row takes the result of the previous one. In the AGS OTP variables this row is not displayed
SummaryIt shows the result of the selection with a readable sentenceIt is not filled, it only shows; when it is hovered over, the long form opens in the tooltip
SubmitIt writes the selection into the field and closes the windowIt cannot be clicked while there is a missing or invalid argument

In the list there are only the variables that can be produced in that field. When the same field is opened on a TCP vService, the list gets shorter; in a field that works at the response stage, the variables that belong to the response also enter the list.

How the Selected Variable Appears in the Field ​

After the selection, not a raw text but a label that shows the variable appears in the field:

  • In the narrow fields and in the content editors the short name appears: such as [↓IP], [↑Code] and [↓Country]. When the label is hovered over, its long name comes out in the tooltip.
  • In the cache, tracking, bandwidth and sampling key lists the long name appears: such as [Source (client) IP address]; in these lists the short name comes out in the tooltip. In the Hash key, Custom format format keys and the manual log entries, on the other hand, the short name appears.
  • When the label is clicked, the window opens again with the Edit variable title and the variable, its argument and its functions are changed. In the content page editor the window opens with the Add variable title in this case as well.

In the content and text fields the variable is placed inside the text as this label; the text and the variable can be used mixed in the same field.

In Which Sections It Is Encountered ​

SectionFieldWhat it is used for
vService · Persistence: Hash basedHash keyTo produce the key that determines to which server the request will go
vService · Session ID format: Custom FormatCustom format format keysTo form the session identity from the values specific to the client
vService · Debug onEntry value in the Custom debug log entries tableTo write the fields wanted into the debug log
Backend Service · Backend Group, SSL service checkedSNITo produce from the request the SNI information that will be sent to the Backend Service
The cache profile · Dynamic caching onKeyTo separate the cache record according to the request
The log profileManual Log Line Format · Manual log entriesTo write the fields wanted into the log line
The actions · traffic trackingFields to trackTo count the traffic according to its source and to take an action according to the threshold
The actions · the quarantine (Tracking key: Manual)Quarantine keys to trackTo define the source that will be taken into quarantine
The actions · the captcha (Tracking type: Manual)Quarantine tracking keysTo define the source in the captcha quarantine
The actions · redirection, header, path, traffic variableRedirect location · Header content · New path info · Variable valueTo produce the address, the header or the variable from the request
The actions · bandwidth (Limit type: Dynamic)KeyTo determine for whom the limit will be applied separately
The actions · traffic mirroring (sampling on)Sampling keyTo determine according to which value the requests to be copied will be selected
The content pagesContentTo write the information that belongs to the request onto the page shown
WAF · the blocking page source Manual contentBlocking pageTo write the information that belongs to the request onto the blocking page
Bot/DDoS · the protection and quarantine cardsRedirect location · Quarantine tracking keysTo define the redirect location and the quarantine source

Besides these, the same window is used in the Dynamic Condition, Dynamic List and AGS Condition conditions, in the report columns and in the AGS fields as well. The full list of the fields is on the Variables page.

Which Group for Which Job ​

The job to be doneThe group to look at
To identify the source (the tracking, quarantine, limit and persistence key)Connection info
To make a decision according to the path, the method or the addressRequest info
To read a header or cookie valueHTTP header info
To extract data from the bodyBody info
To write the period and the time into the log lineTime info
To write the counter and the amount transferredStats
To separate the client according to the country, the browser or the bot stateClient info
To produce content according to the WAF resultWAF
To use the certificate and encryption informationSSL info
To read the amount of requests and data in a certain periodTracking info
To combine more than one value and make a single keyCreate variable
To make an operation according to the authenticated userAGS variables
To use the status code of the responseThe Response Line (the group without a label)
To write where the response comes from into the log lineResponse source
The cache, the compression, the random number and the manual variablesOthers

All of the groups and the variables inside them are on the Variables page.

The Functions ​

If the value as it is is not enough, the Add functions row is opened and the value is used processed: converting to lowercase, taking a hash, extracting a field from inside JSON or XML, narrowing an IP address to a block, comparing with a list and so on. The functions are added one after another and are applied in the order in which they are added.

All of the functions are on the Converters page.

Sections ​