Search…
include

Overview

The include statement is used to combine Transcript task files together

Syntax

includetaskfile

Details

The include statement is used to combine two or more task files into a single script prior to commencement of execution.
If using the Windows path delimiter - \ - it is advisable to put the path+filename in double quotes to avoid the backslash being interpreted as an escape character
Before executing a task file, Transcript analyses the script and processes all the include statements. Wherever an include statement is encountered, the specified taskfile is read from disk and inserted into the script in place of the include statement itself.

Command placement

As with most statements, include must occupy a single line of its own in the script.

Additional notes

The taskfile argument is treated as relative to <basedir>/system/config/transcript/.
Multiple files may be included in a task file and any included file may include other files but a check is done to ensure that no infinite include loops are generated.

Example

Given the following two files in /system/config/transcript/ ...
1
# FILE 1: myscript.trs
2
option loglevel = DEBUGX
3
4
# import usage data from csp
5
import "system\extracted\AzureCSP\${dataDate}_csp_usage.csv" source CSP alias Usage
6
default dset csp.usage
7
rename column resource_id to meter_id
8
9
include import_customers.trs
10
11
option overwrite = no
12
set resource_subcategory to Generic
13
create column interval value individually
14
create mergedcolumn service_name separator " - " from resource_name resource_subcategory region
15
# etc ...
Copied!
1
# FILE 2: import_customers.trs
2
import "system\extracted\AzureCSP\${dataDate}_csp_customers.csv" source CSP alias Customers
3
rename column CSP.Customers.ID to customer_id
4
# END FILE 2
Copied!
Prior to execution the pre-processor will combine these into the single memory-resident Transcript task:
1
# FILE 1: myscript.trs
2
option loglevel = DEBUGX
3
4
# import usage data from csp
5
import "system\extracted\AzureCSP\${dataDate}_csp_usage.csv" source CSP alias Usage
6
default dset csp.usage
7
rename column resource_id to meter_id
8
9
# FILE 2: import_customers.trs
10
import "system\extracted\AzureCSP\${dataDate}_csp_customers.csv" source CSP alias Customers
11
rename column CSP.Customers.ID to customer_id
12
# END FILE 2
13
14
option overwrite = no
15
set resource_subcategory to Generic
16
create column interval value individually
17
create mergedcolumn service_name separator " - " from resource_name resource_subcategory region
18
# etc ...
Copied!
Last modified 2yr ago