Split
Last updated
Last updated
Split 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.
Step 1: Create an empty split_example_1 using AIOps studio as shown in the below screenshot.
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.
##### 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
Step 3: Click verify button to make sure syntax and pipeline code is correct (as shown below)
Step 4: Click execute button and execute the pipeline. RDA will execute the pipeline without any errors (as shown below)
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. 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.