Pre/Post Variables
HST Server supports an extensive set of variables that can be used in prepost scripts.
Note: The "File Pre- and Post-Processing (Prepost)" feature will be deprecated from HST
Server and HST Endpoint in versions 4.0 and onward. At that time, customers should
use Inline File validation with Lua (Inline File Validation with Lua Script) or an
External URL validator (Out-of-Transfer File Validation) for pre-post processing
features.
The following tables list all pre/post variables for setting up pre- and post-processing. Some can be applied only to sessions, some only to files, and some to both sessions and files.
Pre/post variable considerations:
- Pre/post variables are case-sensitive.
- Pre/post variables that can be arbitrarily long (values marked with * below) are truncated by prepost scripts.
For Sessions and Files
| Variable | Description | Values | Example |
|---|---|---|---|
| COOKIE | The user-defined cookie string. | string* | "$COOKIE" == cookie-string |
| DIRECTION | The transfer direction. |
|
"$DIRECTION" == send |
| ERRCODE | The error code. | string | "$ERRCODE" == 1 |
| ERRSTR | The error string. | string | "$ERRSTR" == FASP error |
| MANIFESTFILE | The full path to the manifest file. | string* | "$MANIFESTFILE" == /log |
| PEER | The peer name or IP address. | string or valid IPv4 address | "$PEER" == 10.0.0.1 |
| SECURE | Transfer encryption. |
|
"$SECURE" == no |
| SESSIONID | The session id. | string | "$SESSIONID" == 1 |
| STARTSTOP | The status start or stop. |
|
"$STARTSTOP" == Start |
| STATE | The transfer state. |
|
"$STATE" == success |
| TYPE | The event type. |
|
"$TYPE" == Session |
| USER | The user name | string | "$USER" == aspera_user_1 |
| USERID | The user ID | string | "$USERID" == 501 |
| USERSTR | The user string, such as additional variables. | string* | "$USERSTR" == -q |
For Sessions
| Variable | Description | Values | Example |
|---|---|---|---|
| FILE1 | The first file. | string* | "$FILE1" == first-file |
| FILE2 | The second file. | string* | "$FILE2" == second-file |
| FILECOUNT | The number of files. | positive integer | "$FILECOUNT" >= 5 |
| FILELAST | The last file. | string* | "$FILELAST" == last-file |
| LICENSE | The license account and serial number. | string | "$LICENSE" == license-string |
| MINRATE | The initial minimum rate, in Kbps. | positive integer | "$MINRATE" == 50 |
| PEERLICENSE | The peer's license account and serial number. | string | "$PEERLICENSE" == license-string |
| RATEMODE | The transfer policy. |
|
"$RATEMODE" == adapt |
| SOURCE | The full path of the source file. | string* | "$SOURCE"== /tmp |
| TARGET | The full path of the target directory. | string* | "$TARGET" == . |
| TARGETRATE | The initial target rate, in Kbps. | positive integer | "$TARGETRATE" == 100 |
| TOTALBYTES | The total bytes transferred. | positive integer | "$TOTALBYTES" >= 100000000 |
| TOTALSIZE | The total size of files being transferred in bytes. | positive integer | "$TOTALSIZE" >= 500000000 |
For Files
| Variable | Description | Values | Example |
|---|---|---|---|
| DELAY | The measured network delay, in ms. | positive integer | "$DELAY" <= 1 |
| FILE | The file name. | string* | "$FILE" == file-name |
| FILE_CSUM | Destination checksum of the most recently transferred file. | string | "$FILE_CSUM" == checksum |
| LOSS | The network loss in percentage. | double-digit fixed point value | "$LOSS" >= 5.00 |
| OVERHEAD | The total number of duplicate packets. | positive integer | "$OVERHEAD" >= 1 |
| RATE | The transfer rate in Kbps. | double-digit fixed point value | "$RATE" >= 10.00 |
| REXREQS | The total number of retransmission requests. | positive integer | "$REXREQS" >= 3 |
| SIZE | The file size in bytes. | positive integer | "$SIZE" >= 5000000 |
| STARTBYTE | The start byte if resumed. | positive integer | "$STARTBYTE" >= 100000 |