Documentation forServ-U MFT & Serv-U FTP Server

System variables

You can customize certain configurable messages in Serv-U to include a wide range of variables as outlined in the following list. These variables are replaced at run time with the appropriate value allowing up-to-date statistics and feedback to be provided to logged in users. Some of the places where you can use these variables include event messages, customized FTP command responses, or a welcome message.

Furthermore, you can also use the %USER%, %HOME%, %USER_FULL_NAME%, and %DOMAIN_HOME% variables. For more information about these variables, see Group properties: Directory access.

When you use macros, in general, it is best to use $ macros for events and in system messages (such as login messages or customized FTP responses) and % macros for configuration values. Many of the $ macros do not have explicit values until a session has been successfully established or a specific action has taken place, whereas the % macros have explicit values at all times.

All variables are case sensitive. Statistical information, unless otherwise specified, is calculated since the Serv-U File Server was last started.

Server information

Variable Description
$ServerName Displays the full name of the server (that is, Serv-U).
$ServerVersionShort Displays the first two digits of the current version of the Serv-U File Server (for example, 15.1).
$ServerVersionLong Displays the full version number of the Serv-U File Server (for example, 15.1.0.480).
$OS Displays the name of the operating system (for example, Windows Server 2008 R2).
$OSVer Displays the full version number of the operating system (for example, 6.1.7601).
$OSAndPlatform Displays the name of the operating system (for example, Windows Server 2008 R2) and platform (for example, 32-bit or 64-bit).
$OSCaseSensitive States if the operating system is case sensitive.
$ComputerName Displays the name of the computer retrieved from the operating system, normally the same as the UNC name on a Windows network (for example, WEB-SERVER-01).
$EventName Contains the configured name of the event.
$EventType Contains the type of the event that was triggered.
$EventDescription Contains the configured description of the event.
$LogFilePath Retrieves the path to the log file (Log File Deleted and Log File Rotated Events only).
$OldLogFilePath Retrieves the old path to the log file (Log File Rotated Events only).
$GatewayIPAddress Retrieves the Gateway IP address (Gateway Listener Success, Gateway Listener Failure, Permanent Gateway Listener Success, Permanent Gateway Listener Failure Events only).
$GatewayPort Retrieves the Gateway port (Gateway Listener Success, Gateway Listener Failure, Permanent Gateway Listener Success, Permanent Gateway Listener Failure Events only).
$ListenerIPAddress Retrieves the listener IP address (Listener Success, Listener Failure, Permanent Listener Success, Permanent Listener Failure Events only).
$ListenerPort Retrieves the listener port (Listener Success, Listener Failure, Permanent Listener Success, Permanent Listener Failure Events only).
$ListenerType Retrieves the listener type (Listener Success, Listener Failure, Permanent Listener Success, Permanent Listener Failure Events only).
$ListenResult Retrieves the listener result (Listener Success, Listener Failure, Permanent Listener Success, Permanent Listener Failure Events only).

Server statistics

Variable Description
$ServerDays Displays the total number of days the server has been online continuously.
$ServerHours Displays the number of hours from 0 to 24 the server has been online, carries over to $ServerDays.
$ServerMins Displays the number of minutes from 0 to 60 the server has been online, carries over to $ServerHours.
$ServerSecs Displays the number of seconds from 0 to 60 the server has been online, carries over to $ServerMins.
$ServerKBup Displays the total number of kilobytes uploaded.
$ServerKBdown Displays the total number of kilobytes downloaded.
$ServerFilesUp Displays the total number of files uploaded.
$ServerFilesDown Displays the total number of files downloaded.
$ServerFilesTot Displays the total number of files transferred, essentially ($ServerFilesUp + $ServerFilesDown).
$LoggedInAll Displays the total number of established sessions.
$ServerUploadAvgKBps Displays the average upload rate in KB/s.
$ServerDownloadAvgKBps Displays the average download rate in KB/s.
$ServerAvg Displays the average data transfer rate (uploads and downloads) in KB/s.
$ServerUploadKBps Displays the current upload transfer rate in KB/s.
$ServerDownloadKBps Displays the current download transfer rate in KB/s.
$ServerKBps Displays the current aggregate data transfer rate in KB/s.
$ServerSessions24HPlusOne Displays the total number of sessions in the past 24 hours plus one additional session.
$ServerSessions24H Displays the total number of sessions in the past 24 hours.

Domain statistics

Variable Description
$DomainKBup Displays the total number of kilobytes uploaded.
$DomainKBdown Displays the total number of kilobytes downloaded.
$DomainFilesUp Displays the total number of files uploaded.
$DomainFilesDown Displays the total number of files downloaded.
$DomainFilesTot Displays the total number of files transferred, essentially ($DomainFilesUp + $DomainFilesDown).
$DomainLoggedIn Displays the total number of sessions currently connected.
$DomainUploadAvgKBps Displays the average upload rate in KB/s.
$DomainDownloadAvgKBps Displays the average download rate in KB/s.
$DomainAvg Displays the average aggregate data transfer rate (uploads and downloads) in KB/s.
$DomainUploadKBps Displays the current upload transfer rate in KB/s.
$DomainDownloadKBps Displays the current download transfer rate in KB/s.
$DomainKBps Displays the current aggregate data transfer rate in KB/s.
$DomainSessions24HPlusOne Displays the total number of sessions in the past 24 hours plus one additional session.
$DomainSessions24H Displays the total number of sessions in the past 24 hours.

User statistics

This data applies to all sessions attached to the user account.

Variable Description
$UserKBUp Displays the total number of kilobytes uploaded.
$UserKBDown Displays the total number of kilobytes downloaded.
$UserKBTot Displays the total amount of kilobytes transferred.
$UserLoggedIn Displays the total number of sessions.
$UserUploadAvgKBps Displays the average upload rate in KB/s.
$UserDownloadAvgKBps Displays the average download rate in KB/s.
$UserAvg Displays the average aggregate data transfer rate (uploads and downloads) in KB/s.
$UserUploadKBps Displays the current upload transfer rate in KB/s.
$UserDownloadKBps Displays the current download transfer rate in KB/s.
$UserKBps Displays the current aggregate data transfer rate in KB/s.
$UserSessions24HPlusOne Displays the total number of sessions in the past 24 hours plus one additional session.
$UserSessions24H Displays the total number of sessions in the past 24 hours.

Last transfer statistics

This data applies to the most recently completed successful data transfer.

Variable Description
$TransferBytesPerSecond Displays the effective (compressed) transfer rate in bytes/s.
$TransferKBPerSecond Displays the effective (compressed) transfer rate in KB/s.
$TransferBytes Displays the effective (compressed) number of bytes transferred, formatted for display, for example, 32,164.
$NoFormatTransferBytes Displays the effective (compressed) number of bytes transferred, unformatted, for example, 32164.
$TransferKB Displays the effective (compressed) number of kilobytes transferred, formatted for display.
$ActualTransferBytesPerSecond Displays the actual (uncompressed) transfer rate in bytes/s.
$ActualTransferKBPerSecond Displays the actual (uncompressed) transfer rate in KB/s.
$ActualTransferBytes Displays the actual (uncompressed) number of bytes transferred, formatted for display, for example, 32,164.
$NoFormatActualTransferBytes Displays the actual (uncompressed) number of bytes transferred, unformatted, for example, 32164.
$ActualTransferKB Displays the actual (uncompressed) number of kilobytes transferred, formatted for display.
$CompressionRatio Displays the ratio of compression for the transfer expressed as a percentage of the expected amount of data transferred. For example, a value of 100.00 means the data could not be compressed. A value of 200.00 means the data compressed to half its original size.
$CommandResult Displays the command result in the return response of any command, providing information such as compression level, and so on. (FTP only)
$Command Displays the FTP command name, such as RETR, MODE, or SIZE. (FTP only)
$Parameters Displays the parameters used for the command, such as "Z" for the MODE command indicating the compression type, a file name for the STOR command, and so on. (FTP only)
$DataMode Displays the data transfer mode for an FTP data transfer, which may be either BINARY for binary mode transfers or ASCII for ASCII mode data transfers. (FTP only)
$CurrentCompressedTransferBytes Displays the current effective (compressed) number of bytes transferred so far, unformatted, for example, 32164. (FTP only)
$CurrentUncompressedTransferBytes Displays the current actual (uncompressed) number of bytes transferred so far, unformatted, for example, 32164. (FTP only)

Date/Time

Variable Description
$Date Displays the current date according to the Serv-U File Server, in the local date format of the system.
$Time Displays the current time according to the Serv-U File Server, in the local time format of the system.
$Day Displays the day of the month.
$Month Displays the two-digit numeric month.
$TextMonth Displays the text version of the month.
$Year Displays the four-digit year.
$2DigitYear Displays the two-digit year.
$Hour Displays the hour (24-hour clock).
$Minute Displays the minute.
$Second Displays the second.

Server settings

Variable Description
$MaxUsers Displays the maximum number of sessions allowed to log in, which could be limited by the license.
$MaxAnonymous Displays the maximum number of anonymous users allowed to log in.

Session information

This information applies to the current session.

Variable Description
$Name Displays the login ID of the attached user account.
$LoginID Displays the session's login ID, operates like $Name. $Name can refer to the login ID for target user accounts but $LoginID refers only to the login ID of the session.
$IP Displays the client IP address.
$IPName Displays the reverse DNS name as obtained by performing a reverse DNS lookup on $IP.
$Dir Displays the session's current directory.
$Disk The local drive letter being accessed.
$DFree Displays the amount of free space on $Disk in MB.
$FUp Displays the total number of files uploaded.
$FDown Displays the total number of files downloaded.
$FTot Displays the total number of files transferred, essentially ($FUp + $FDown).
$BUp Displays the total number of kilobytes uploaded.
$Bdown Displays the total number of kilobytes downloaded.
$BTot Displays the total number of kilobytes transferred.
$TConM Displays the total number of minutes the session has been connected.
$TConS Displays the number of seconds from 0 to 60 that the session has been connected, carries over to $TconM.
$RatioUp Displays the 'upload' portion of the applied ratio, "N/A" if not in use.
$RatioDown Displays the 'download' portion of the applied ratio, "N/A" if not in use.
$RatioType Displays the type of ratio being applied, either per session or per user.
$RatioCreditType Displays the type of ratio credit granted for transfers, either per bytes or per complete file.
$RatioCredit Displays the current transfer credit for the applied ratio, either megabytes or complete files.
$QuotaUsed Displays how much disk quota is currently being used in MB, "Unlimited" if no quota is in use.
$QuotaLeft Displays how much disk quota is available in MB, "Unlimited" if no quota is in use.
$QuotaMax Displays the maximum amount of disk space that can be used in MB, "Unlimited" if no quota is in use.
$CurrentDirMaxSize Displays the maximum size of the current directory in MB. If the directory has no size limit, the variable will return "unlimited". If permission is denied in the directory, or any other error occurs, the value "N/A" will be returned.
$SessionID Displays the unique session ID of the current session. Session IDs are counted from 000001, and the counter is reset each time Serv-U is started.
$Protocol Displays the current protocol being used (FTP, FTPS, HTTP, HTTPS, or SFTP (SSH2)).
$UserDomainName Uses either the logged in domain name or the user's parent domain name. A blank name is returned if the user is a global server user that is not logging in.
$DomainName Displays the current domain that the session is logged into.
$DomainDescription Displays the description of the current domain that the session is logged into.
$TimeRemaining Displays the time remaining when blocking an IP address for an amount of time (available only in Event notifications).
$LocalHomeDirectory Displays the local home directory. It should only be used for events that need this specific information such as user creation.
$UserEmailAddress Displays the user's email address.
$FullName Displays the user's full name as entered into the "Full Name" field for a user account.
$SpaceFullName The same as "$FullName" with the addition of a space before the user's full name. Blank (no space or name) when the user's full name is empty.
$FullNameSpace The same as "$FullName" with the addition of a space after the user's full name. Blank (no space or name) when the user's full name is empty.
$Port Displays the port number of the client.
$ServerIP Displays the IP address of the server.
$ServerPort Displays the port number of the server.

Using the $IPName variable inside of an event or sign-on message can cause a slight delay while the reverse DNS information for $IP is retrieved.

File information

This information applies to the last remotely accessed file, which is not necessarily the last transferred file.

Variable Description
$PathName Retrieves the full remote path.
$FileName Retrieves only the file name from $PathName.
$FileSize Retrieves the size, in bytes, of the file from $FileName.
$FileSizeFmt Displays a formatted version of the file size, containing the thousands separator (comma or period depending on the computer's regional settings).
$FileSizeKB Displays a formatted floating point value representing the file size in KB.
$LocalPathName Retrieves the fully qualified local path name for an operation, as it relates to Windows. For example C:\Temp\File.fid instead of /Temp/file.fid.
$LocalFileName Retrieves the name of the file as it is stored on the local computer. See $LocalPathName for details.
$OldLocalPathName Same as $LocalPathName, but contains the path prior to renaming.
$OldLocalFileName Same as $LocalFileName, but contains the file name prior to renaming.
$OldPathName Retrieves the remote path name prior to renaming.
$OldFileName Retrieves the remote file name prior to renaming.

Current activity

Variable Description
$UNow Displays the current number of sessions on the Serv-U File Server.
$UAll Displays the total number of sessions that have connected to the Serv-U File Server since it was last started.
$U24h Displays the total number of sessions that have connected to the Serv-U File Server in the last 24 hours.
$UAnonAll Displays the current number of sessions attributed to the anonymous user on the Serv-U File Server.
$UAnonThisDomain Displays the current number of sessions attributed to the anonymous user on the connected domain.
$UNonAnonAll Displays the current number of sessions not attributed to the anonymous user on the Serv-U File Server.
$UNonAnonThisDomain Displays the current number of sessions not attributed to the anonymous user on the connected domain.
$UThisName Displays the current number of sessions attributed to the connected user account.

FileShare

Variable Description
$FileShareToken Used in download/upload events.
$FileShareExpires Displays the link expiration date.
$FullName Displays the Serv-U username of the user who shared the file.
$FileShareTokenURL Displays the fileshare URL.
$FileShareComments Displays an optional message.