At line 1 changed 4 lines |
All have a start and end, and use curly brackets. Some take additional parameters separated by colons. : |
|
They are also processed in this order of sequence as listed here:\\ |
|
Function syntax consists of a start and end tag, the function name to be enclosed in curly brackets. Take at least one parameter as "argument". Some take additional parameters separated by colon characters. Generic syntax: |
{{{ |
{functionname_start:optionalargument1:optionalargument2}argument{functionname_end} |
}}} |
The arguments can be text or numeric literals or server variables. Special case of optional arguments, when these contain the colon (:) character itself, that needs to be manually encoded as ~..~. |
The functions are processed by the replacement engine in this very order of sequence as listed here.\\ |
---- |
!General purpose |
\\ |
At line 22 added 8 lines |
VRL encodes the inner data....@ becomes {at}, % becomes {percent} etc. |
{{{ |
vrlencode_start |
}}} |
VRL decodes the inner data. {at} becomes @ etc |
{{{ |
vrldecode_start |
}}} |
At line 49 changed one line |
Safeguards the text for raw SQL preventing ' and ; and %, etc risks in input text. |
Safeguards the text for raw SQL preventing ' and; and %, etc risks in the input text. |
At line 71 added 2 lines |
\\Example_2: {substring_start:-4:-1}something to find{substring_end} would result in 'find' |
\\The -4 is 4 from the end, and the -1 means all the way to the end. If you did a positive 1 it would do 1 character from the 4th character to the end. |
At line 77 changed one line |
Add an amount tot he number. Example: {add_start:500}1000{add_end} results in 1500. |
Add an amount to the number. Example: {add_start:500}1000{add_end} results in 1500. |
At line 81 changed one line |
Parsing a date to a millisecond value. Example: {parse_start:MMddyy HH~..~mm~..~ss}042578 22:43:12{parse_end} Note how the sideways colon is used to represent the colon since colon is our separator character. ~..~ means : in functions where that scenario occurs. |
Parsing a date to a millisecond value. Example: {parse_start:MMddyy HH~..~mm~..~ss}042578 22:43:12{parse_end} Note how the sideways colon is used to represent the colon since colon is our separator character. ~..~~ means: in functions where that scenario occurs. For strict parsing use character '__=__' at the beginning of the date format like {parse_start:__=__MM/dd/yyyy}. It will parse only valid dates and fails for example for __13__/02/2022 (Month maximum number is __12__). |
At line 89 changed one line |
Grab a part of a formatted URL. Example: {url_start:host}ftp://demo:demo@crushftp.com/demo/folder/file.txt{url_end} would result in 'crushftp.com' |
Grab a part of a formatted URL. Example: {url_start:host}ftp://demo:demo@crushftp.com/demo/folder/file.txt{url_end} would result in 'crushftp.com'. Valid items: |
protocol, user, pass, host, port, path, file, and query in this order. |
At line 93 changed one line |
Do very basic math operation on text formatted math. Example: {math_start:l}5+5{math_end} would result in 10. The l is for LONG. f is for FLOAT. i is for INTEGER, which is the default. So {math_start:f}5+5{math_end} would result in 10.0 |
Get the length of the inner data. Example: {length_start}blah{length_end} would result in 4. |
At line 111 added 4 lines |
length_start |
}}} |
Do very basic math operations on text formatted math. Example: {math_start:l}5+5{math_end} would result in 10. The l is for LONG. f is for FLOAT. i is for INTEGER. d is for big numbers (double of the integer) which is the default. So {math_start:f}5+5{math_end} would result in 10.0 |
{{{ |
At line 117 added 58 lines |
Reference a list of user attributes, separated by a delimitator character, of a group of users. Example: {group_start:email:MainUsers:,}Mygroup{group_end} comma-separated list of user e-mail addresses members of Mygroup from MainUsers connection group |
{{{ |
group_start |
}}} |
Trace geographically an IP using https://freegeoip.net, for example {geoip_start}{user_ip}{geoip_end} in a user task |
{{{ |
geoip_start |
}}} |
Turn off function replacement. If the text starts with the variable {ignore_functions} function replacement will be turned off. |
{{{ |
ignore_functions |
}}} |
Log custom text to CrushFTP.log |
{{{ |
{log_start}some text, or {variables}{log_end} |
}}} |
\\ |
---- |
\\ |
!Special functions that only work in the UserVariable task\\ |
__Save, Load, and Add to named list items in a job flow. (UserVariable task only) (CrushFTP 10.3.0_43+ supports this)__\\ |
Save a copy of the current list to the name in the function (applying the filter of the UserVariable task) |
{{{ |
save_list_start |
}}} |
Load a list into the current list and start using it. The existing list is discarded. |
{{{ |
load_list_start |
}}} |
Add the current item to a named list. |
{{{ |
add_list_start |
}}} |
\\ |
---- |
__Parse in a JSON object, explode to a list of key name - key value pairs__ |
{{{ |
json_parse_start |
}}} |
Use it like {json_parse_start}{myJson}{json_parse_end} with it's argument a variable referencing a JSON object. Can dereference a particular key value with the key name enclosed in curly brackets ( like {mykey1} ). It doesn't work with nested JSON structures.\\ |
\\ |
__Parse in an XML file, explode to a list of key name - key value pairs__\\ |
\\ |
__!!!Restriction:__ Only works for XML attributes: __type="properties"__ or __type="vector"__.\\ |
\\ |
{{{ |
{xml_parse_start}{file_contents}{xml_parse_end} |
}}}\\ |
\\ |
You can also convert the input XML into a parsable format:\\ |
{{{ |
{xml_parse_start}{replace_start:<mytag:<mytag type="properties"}{file_contents}{replace_end}{xml_parse_end} |
}}}\\ |
{{{ |
{xml_parse_start}{replace_start:<mytag:<mytag type="vector"}{file_contents}{replace_end}{xml_parse_end} |
}}} |
\\ |
|