Initialize
Initialize inputs using JavaScript constructors to perform the following functions:
Validate launch arguments and halt the pipeline if unnecessary.
Load .csv/.tsv lookup files to enrich TenXObject and summary instances.
Connect to GeoIP DBs to geo-reference IP addresses.
Initialize counters and dictionaries.
The example below from http.js loads an HTTP message lookup based on the value of a launch argument.
/**
* Input constructors are designed to initialize specific resources at the start of pipeline execution.
*/
export class HttpInput extends TenXInput {
/**
* This constructor loads the 'http.csv' lookup table to enrich instances of 'HttpSummary' below.
*/
constructor() {
if !TenXLookup.load("data/run/lookup/http.csv", true)
throw new Error("could not load HTTP lookup!");
}
To load input constructors see JavaScript configuration.
Options
Specify the options below to configure multiple Input JavaScript:
| Name | Description |
|---|---|
| inputActionsClassName | JavaScript class name |
| inputActions | 10x JavaScript statements to execute |
| inputActionsFile | Declaring .js file |
inputActionsClassName
JavaScript class name.
| Type | Required | Names |
|---|---|---|
| String | ✔ | [inputActionsClassName, TenXInputClassName] |
Specifies the JavaScript class name in which inputActions are defined.
inputActions
10x JavaScript statements to execute.
| Type | Default | Names |
|---|---|---|
| List | [] | [inputActions, TenXInput] |
JavaScript statements for initializing target input(s).
NOTE: This argument is not designed to be set directly, but instead by passing a .js launch file containing these statements nested within an TenXInput sub-class constructor as described above.
inputActionsFile
Declaring .js file.
| Type | Default | Names |
|---|---|---|
| String | "" | [inputActionsFile, TenXInputFile] |
Specifies the .js file name declaring inputActions.
This unit is defined in input/unit.yaml.