Server Variables

With server variables, pass values to post-processing and scheduled actions dynamically at run time. For example, when you configure a copy action for a post-processing event, specify the destination URL as {parent_path} and the rename file to parameter as {name}_processed. When the event is triggered, IBM® webMethods Managed File Transfer copies the file to the parent directory and appends _processed to the end of the file name.

IBM webMethods Managed File Transfer supports the following:

  • General variables that handle special characters and error messages.
  • Variables that pertain to file references.
  • Variables that pertain to date and time formats.
  • User variables that pertain to the content of emails that are sent to users.
Note: The variables are case-sensitive.

General Variables

Variable Description Supported Event Type
{r} Return character. Post-processing and scheduled events
{n} New line character. Post-processing and scheduled events
{task_error} Returns the last error that occurred in an event. Post-processing and scheduled events
{task_errors} Returns the list of all the errors in an event. Post-processing and scheduled events
{error_trace} Used to get the stack trace in case of any exception. Post-processing and scheduled events
{event_execution_id} Returns the event execution ID which is unique for each event. Post-processing and scheduled events
{task_error_types} Returns the type of actions where the error occurred. Post-processing and scheduled events
{host name} Host name of IBM webMethods Managed File Transfer. Post-processing and scheduled events
{outbound_proxy_alias } Proxy server name that is defined for use with an event. Post-processing and scheduled events
{task_error_names} Name of the event that results in an error. Post-processing and scheduled events
{parent_url} Actual URL that points to the parent folder in which the file resides. Post-processing and scheduled events
{parent_url_decoded} Decoded value of the variable {parent_url}. Post-processing and scheduled events
{event_name} Name of the action. Post-processing and scheduled events
{ssl_protocol} SSL/TLS version used for the HTTPS or FTPS protocol for a session. Post-processing event
{ssl_cipher} Cipher algorithm used for the HTTPS or FTPS protocol for a session. Post-processing event
{random_string} Generates a random string. Post-processing and scheduled events
{tenant_name} Used to obtain the name of the tenant. For example, when you have multiple tenants, use this variable in an email task to find the tenant from which the email originated. Post-processing and scheduled events
{pod_name} Used to obtain the name of the pod. This variable returns the value mft-0 for a single pod development or test tenant, and returns the value mft-0 or mft-1 for a production tenant. Post-processing and scheduled events

File Reference Variables

Note: In event actions such as Send Email which process multiple files, use the variables as per the following example:
<LINE>{stem}{ext}
</LINE>

This syntax ensures that all the files in the list are processed by these actions instead of just the first file.

Variable Description Supported Event Type
{command} Command forwarded to remote FTP servers to list files. N/A
{end} End time for the file transfer. Post-processing event
{error} Error messages related to the file transfer. Post-processing and scheduled events
{ext} Last part of the file name, including the period. Post-processing and scheduled events
{file_metadata} Applicable only to FTP remote servers. Raw response from the remote server for each file while performing MLST, MLSD, LIST, or NLST commands.Example:Type=file;Modify=20151006091701;Perm=r,w,a,d,f;Size=584;UNIX.owner=user;UNIX.group=group;properties_4.cnf. Scheduled event
{group} Applicable only to FTP remote servers. Retrieves information from the UNIX ownership class group, os-depend-fact in MLST RFC 3659. Scheduled event
{md5} MD5 hash of the uploaded file. N/A
{modified} Applicable only to FTP remote servers. Date when the file was last modified in UNIX epoch time (milliseconds). Scheduled event
{name} Name of the file. Post-processing and scheduled events.
{owner} Applicable only to FTP remote servers. Retrieves information from the UNIX ownership class owner, os-depend-fact in MLST RFC 3659. Scheduled event
{parent_path} Path to the parent folder. Scheduled event
{path} Path of the file. Relative path of the file in a file system with respect to the current folder. Post-processing and scheduled events
{permissions} Applicable only to FTP remote servers. Permission for the file on the remote server to which IBM webMethods Managed File Transfer is connected. The format is -rw-r--r--. For MLST, this format is maintained only when unix.mode is available. If unix.mode is not available, the format is r,w,a,d,f, and is retrieved from perm. Scheduled event
{real_parent_path} Path of the parent folder for the file on the disk. Post-processing and scheduled events
{real_parent_path_decoded} Decoded value of the variable. {real_parent_path} Post-processing and scheduled events
{real_path} Complete path to the file in the file system. Post-processing and scheduled events
{real_path_decoded} Decoded value of the variable. {real_path} Post-processing and scheduled events
{resume_loc} Location in the file where the transfer should resume if interrupted. Post-processing and scheduled events
{size} Size of the file. Post-processing and scheduled events
{speed} Speed of the file transfer.
Note: When the actual speed is 0, this variable value might be inaccurate.
Post-processing and scheduled events
{start} Start time for the file transfer. Post-processing event
{stem} First part of the file name, before the period. Post-processing and scheduled events
{the_file_error Any error during file transfer. Post-processing and scheduled events
{the_file_name} Name of the file. Post-processing and scheduled events
{the_file_size_formatted} Size of the file. Post-processing and scheduled events
{the_file_speed} Speed of the file transfer (upload/download) for post-processing events. Post-processing event
{the_file_path} Path of the file. Post-processing and scheduled events
{url} Actual URL that points to the file. Post-processing and scheduled events
{url_decoded} Decoded value of the variable. Post-processing and scheduled events
{user_dir} Folder that the user sees when uploading the file. Post-processing and scheduled events
{user_session_download_count} Total download count per user session for post-processing events. Post-processing event
{user_session_upload_count} Total upload count per user session for post-processing events. Post-processing event
{user_time} User upload/download time for post-processing events. Post-processing event
{items_count} or {item_count} The count of files within an event. Post-processing and scheduled events

Date/Time Variables

Precede any of the date/time variables with the following symbols:

  • Preceding a variable with a dot (.) results in replacing the variable with the current value. For example, {.dd} results in the current day, and {.hh} results in the current hour.
  • Preceding a variable with an underscore (_) results in replacing the variable with the file’s ending transfer time. For example, if a file was downloaded on Monday, and if the event triggered a “file rename” action with a value of Report_{EEE} provided for the new file name, IBM webMethods Managed File Transfer renames the downloaded file to Report_Mon.
  • Date and time-related server variables are evaluated based on the time zone you select in Settings > General settings > Miscellaneous settings > Time zone for Date/Time Variables. The Default selection relates to the Universal Time Coordinated (UTC) time zone.
Variable Description Supported Event Type
{MM} Month. (for example, 06 to represent June) Post-processing and scheduled events
{dd} Date. (for example, 05 to represent the fifth day of the month) Post-processing and scheduled events
{yy} or {yyyy} Year, represented in two digits. (for example, 13 to represent 2013) or four digits (for example, 2013) Post-processing and scheduled events
{HH} Hours, using the 24-hour time format. (for example, 14 to represent the hour of 2 o’clock PM) Post-processing and scheduled events
{hh} Hours, using the 12-hour clock format. (for example, 02 to represent the hour of 2 o’clock PM) Post-processing and scheduled events
{mm} Minutes. Post-processing and scheduled events
{aa} AM or PM Post-processing and scheduled events
{ss} Seconds. Post-processing and scheduled events
{S} Milliseconds. Post-processing and scheduled events
{EEE} Weekday abbreviation. (for example, Mon to represent Monday) Post-processing and scheduled events
{MMM} Month. (for example, 12 to represent the month when the action is executed by IBM webMethods Managed File Transfer Post-processing and scheduled events
{d} Date of the month. Post-processing and scheduled events
{k} Hour in 24-hour format. Post-processing and scheduled events
{K} Hour in 12-hour format. Post-processing and scheduled events
{z} Time zone. (for example, IST) Post-processing and scheduled events
{Z} Time zone. (for example, +5:30 in case of IST) Post-processing and scheduled events
{dd+n}or{d+n}
Current date of the month plus "n" number of days. The final value is calculated based on the calendar days. Example
  • For {dd+1} - If today’s date is 30, the result is either 31 or 1, depending on whether the current month has 30 days or 31 days.
  • For {d+n} - If today's date is 8, the result is 9.
Post-processing and scheduled events
{dd-n}or{d-n}

Current date of the month minus "n" number of days. The final value is calculated based on the calendar days. Example

  • For - If today’s date is 01, the result is either 30 or 31, depending on whether the current month has 30 days or 31 days.
  • For {d+n} - If today's date is 8, the result is 7.
Post-processing and scheduled events

User Variables

Post-process actions triggered as a result of file operations can make use of these variables.

Variable Description Supported Event Type
{firstName} First name of the user. Post-processing and scheduled events
{lastName} Last name of the user. Post-processing and scheduled events
{user_name} User ID of the user. Post-processing and scheduled events
{username} Name of the user who triggers the file operation. (upload, download, or delete) Post-processing events
{email} Email of the user who triggers the file operation. (upload, download, or delete) Post-processing events
{last_name} Last name of the user who triggers the file operation. (upload, download, or delete) Post-processing events
{first_name} First name of the user who triggers the file operation. (upload, download, or delete) Post-processing events