# Split

S**plit**\
Splits the input using the specified 'sep' separator. \
@param sep Type string. Optional ( Default any whitespace characters) \
Input must be a string.\
\
This function allows users to split the string using a token that is provided by the user.&#x20;

### Example 1:&#x20;

Step 1: Create an empty **split\_example\_1** using AIOps studio as shown in the below screenshot. 

![Empty pipeline](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-MeS0-tpoPmrUC2H1qkd%2F-MeS2VeRls0eCRSNtkLx%2FScreen%20Shot%202021-07-12%20at%204.29.38%20PM.png?alt=media\&token=f8d493ea-f8d3-4589-8a16-97d7da83c7b2)

Step 2: Add the following pipeline code/commands into the above-created pipeline as shown in the below screenshot:

You can copy the below code into your pipeline and execute that in your environment.\
\
\&#xNAN;*`##### This pipeline creates an ipaddress list with different IP addresses as string`*\
*`##### in a dataset.`*\
*`##### Pipeline uses RDA dm split the string into three elements using split token ','`*\
*`##### Once the string is split, output is displayed.`*\
\
*`@dm:empty`* \
*`--> @dm:addrow IPV4_Address_List = '10.95.122.15,10.95.122.16,10.95.122.107'`*\
*`--> @dm:map from = 'IPV4_Address_List' & to = 'IP_V4_Address' & func = 'split' & sep = ','`* \
*`--> *dm:filter * get IPV4_Address_List, IP_V4_Address`*<br>

![Pipeline code added to empty pipeline created](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-MeS9LeynkKCXBr4GOD7%2F-MeS9kg3dZdDS3TOvJcw%2FScreen%20Shot%202021-07-12%20at%205.00.55%20PM.png?alt=media\&token=ad86fe79-3865-46d2-90ed-0f1022b30f2c)

Step 3: Click verify button to make sure syntax and pipeline code is correct (as shown below)

![Pipeline code is verified using 'Verify' button as shown above.](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-MeS9o3P8pWzp4U7y7un%2F-MeSA6oEPoTd1OWWTEfR%2FScreen%20Shot%202021-07-12%20at%205.02.38%20PM.png?alt=media\&token=f91b1a6c-bc8b-4e2f-b809-452469ef1e58)

Step 4:  Click execute button and execute the pipeline. RDA will execute the pipeline without any errors (as shown below)

![Successful execution of pipeline without any errors](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-MeSAEeodZVRyf-vJzCv%2F-MeSAUWfbbQpg1hU8r_m%2FScreen%20Shot%202021-07-12%20at%205.04.30%20PM.png?alt=media\&token=d7c3a7b4-968d-4843-98f9-5146b249a90b)

Step 5: RDA uses the dm function split to split the string into multiple elements or tokens based on the separator that was provided by the user.\
\
&#x20;Once the IP list is split using a 'sep' token, the output is stored in another IP\_V4\_Address element.\
\
Note: In addition to the above dm function, the pipeline also uses a dm filter function to select and display the output.

![Successful execution of pipeline using dm function 'split' and prints output ](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-MeSB3Go6UN5yhZHDolB%2F-MeSBSb00JgEpSqkiKK-%2FScreen%20Shot%202021-07-12%20at%205.08.42%20PM.png?alt=media\&token=a03dc978-e947-4e27-8f1d-59970de76a82)
