Integrations
Configure Task Input
12 min
task input types and parameters contain the information that you want your task to ingest you configure task input parameters differently depending upon the types of input for example, script and api input mapping differs from mapping input parameters for plugin or email fields map plugin or email input field parameters when you are configuring plugin or email fields, you are prompted to configure with specified values to specify the type of value, select from the following input types key store the task runs with values from your key store the values are used to pass parameters to the task you specify the keys that will pass the values asset library the task runs with values from an identified asset's library the values are used to pass parameters to the task you specify keys that will pass the values literal value the task runs with a literal value you select that is passed to the task for more information on literal values, see map script or api input field parameters link the task runs with swimlane links as parameters for email fields, you can also indicate the state you want the emails to be in after the task runs you can select between read, unread, or delete you can set conditions for when email will import for the task the conditions check for text, specified in regex, in the email subject, body, or the email sender when you add more than one condition, swimlane processes them using and logic map script or api input field parameters specify script and third party or api inputs on the configuration tab the configuration of the tab varies depending up on the type of input you are working with python scripting allows you to include multiple input variables you can also script based on the assets available through a third party such as splunk, threatconnect, etc script with string interpolation functionality literal values use string interpolation functionality which allows you to build custom strings dynamically by inserting values from record fields and key stores this can be very powerful for any task that accepts a query string to search for data, or for any product endpoint that supports a query language for example index=swimlane and adminkey ={{ key store | get("passkey") }} mongodbkey ={{ key store | get("mongo passkey") }} index=swimlane and domain={{ record | get("domain") }} and severity>60 each record that triggers this task will insert the value from the domain field into this string and pass this query string to the task now each record will search the data in the swimlane index, with the dynamic domain which has a severity greater than 60 swimlane supports parameter names inside quotes, with or without characters, for example {{ key store | get("admin's passkey") }} {{ record | get("admin endpoint") }} {{ key store | get("admin passkey") }} {{ record | get("admin endpoint") }} you can also add parameters for single word text without quotes, for example {{ key store | get(adminspasskey) }} {{ record | get(adminendpoint) }} swimlane also supports formatting, converting and adding/subtracting from datetimes, as well as adding utcnow to the string interpolation for example formatting datetime {{ now | format("yyyy mm dd hh\ mm") }} converting datetime to seconds since the epoch and epoch ms {{ now | date add( 1, d) | epoch }} adding/subtracting datetime {{ now | date add( 3, d) }} will render to a datetime string representing 3 days in the past available data time directives are y, m, d, h, m, s utcnow is included as {{ now }} for more information about swimlane specific coding, see python task api docid\ bhs zxed4oonorurw9ulo task debugger you can test the code in your script by running it through the task debugger in your task, click the configuration tab under the script editor, click the debugger subtab and then click run task to check your script note a check has been added to verify that a user has read permissions on the key store inputs of the task before allowing them to update or debug tasks involving key store inputs the task debugger can run against both script tasks and built in swimlane tasks run the task debugger against existing records for application tasks in order to pull actual values from the record's integrations you can also create a new record from the task debugger to run it against the task debugger cannot run an applet task against a record when the task debugger is running, the run task button will change into a stop task button clicking the stop task button completely stops the debugger from running the task you can also bypass the system task runtime timeout by clicking the settings subtab and clicking the slider this slider temporarily disables the 60 second system timeout and instead has the debugger wait for a response until the task service stop at up to four hours once the task debugger has completed the run, the results are shown in the results window of debugger these results can be copied by clicking copy output the task debugger also detects available parameters once the task debugger completes its run, click the discovered parameters subtab this shows the results of the parameters found during the run this utility will run your actual code so be aware of what you've scripted when running through the debugger review task configuration examples the following screen shows an example of the configuration tab for a third party plugin (or bundle) you configure the fields according to how the plugin is set up some plugins will have many fields and options for configuration this screen shows an example of the configuration tab for a data creation task type this example deals with email, which means that you will need to specify how to handle the records after you've imported an email as part of the task you specify whether the email will appear read, unread, or whether you want the task to delete the email \you will need to setup the task further to have the task delete the email you can also assign conditions, which allow you to run import processes the following screen shows an example of the configuration tab for a script task type the tab opens with a script editor see python task api docid\ bhs zxed4oonorurw9ulo and rest api docid\ mkdqrwmb8edidxd2 swun in the swimlane developer guide for more information you can expand the script editor to a full screen view click this icon to expand the editor to return to the configuration tab view, with the cursor in the editor, press esc the swimlane script editor uses a variation of python editors like pycharm swimlane's editor uses 2 spaces for a tab