Ionix/Smarts ASL: How do I parse based on delimiters using the Adapter Scripting Language?
search cancel

Ionix/Smarts ASL: How do I parse based on delimiters using the Adapter Scripting Language?

book

Article ID: 327754

calendar_today

Updated On:

Products

VMware

Environment

VMware Smart Assurance - SMARTS

Resolution

How do I parse based on delimiters using the Ionix/Smarts Adapter Scripting Language (ASL)?



The following is an example of how you can use an ASL script to parse out fields using delimiters (see Note statement):

Field to be parsed
In the following example, the ipmac field with the value "10.200.5.20,MAC" needs to be parsed up to the delimiting "," character.

START { ..eol
}
do {
   ipmac="10.200.5.20,MAC";
   ip = PARSEIP(ipmac);
   print("ip=".ip);

}

ASL parsing code
The following PARSEIP(ipmac_input) block of ASL code has the delimiter which does the parsing of the field to be parsed. The PARSEIP(ipmac_input) block of code must be added to the top of the main script as a rule, then called from within the loop.

PARSEIP(ipmac_input) {
       input = ipmac_input;
       delim = ",";
       w : word .. eol
}
do {
   return w;
}



Additional Information

See the EMC Ionix or Smarts ASL Reference guide for complete, detailed information on using an ASL script to parse out fields using delimiters.