question

ira avatar image
ira asked Spirent_Admin edited

TL1 Response

Hi. I would like to pull the highlighted text from this response out and put it into variables or a list so I can run a query command on each one. Any help is much appreciated:

  LABBRFDCOCOREDIRLAB3 10-11-01 17:07:48  
M  ira COMPLD  
   "VCG-1-A-4-2-1,PST=IS-NR,SST=[ALM,ACT],ALIAS=IRA-GE-50-1::STS1-1,SUPPTTP=1-A-4-2,CRCTYPE=CRC_32,SPICHANNEL=,DEGRADETH  
RESHOLD=1,CONCATIFTYPE=SONET,STSSIZE=STS1,TUNNELPEERTYPE=ETTP,TUNNELPEERNAME=1-A-4-11,MEMBERFAILCRITERIA=PDI_P&DLOM&LOP_  
P&AIS_P,GFPFCSENABLED=YES,DEFAULTJ1ENABLED=NO,LCASENABLED=YES,LCASHOLDOFFTIMER=0,LCASRSACKTIMER=2,CONFIGMONCHANNEL=VCG-1  
-A-4-2-1-CTP-1,ACTUALMONCHANNEL=VCG-1-A-4-2-1-CTP-1,SCRAMBLINGBITENABLED=YES,FRAMINGMODE=GFP,GROUPMEM=1,PROVBW=1,OPERBW=  
1,MAPPERBUFFERALLOCATION=AUTO,MAPPERBUFFERSAVAILABLE=0,EFFIBASESEV=MJ,VCGFAILUREBASESEV=CR"  
   "VCG-1-A-4-1-4,PST=IS-NR,SST=[ALM,ACT],ALIAS=IRA-GE-1000-3::STS1-1,SUPPTTP=1-A-4-1,CRCTYPE=CRC_32,SPICHANNEL=,DEGRADE  
THRESHOLD=1,CONCATIFTYPE=SONET,STSSIZE=STS1,TUNNELPEERTYPE=ETTP,TUNNELPEERNAME=1-A-4-4,MEMBERFAILCRITERIA=PDI_P&DLOM&LOP  
_P&AIS_P,GFPFCSENABLED=YES,DEFAULTJ1ENABLED=NO,LCASENABLED=YES,LCASHOLDOFFTIMER=0,LCASRSACKTIMER=2,CONFIGMONCHANNEL=VCG-  
1-A-4-1-4-CTP-64,ACTUALMONCHANNEL=VCG-1-A-4-1-4-CTP-64,SCRAMBLINGBITENABLED=YES,FRAMINGMODE=GFP,GROUPMEM=64&&84,PROVBW=2  
1,OPERBW=21,MAPPERBUFFERALLOCATION=AUTO,MAPPERBUFFERSAVAILABLE=0,EFFIBASESEV=MJ,VCGFAILUREBASESEV=CR"  
   "VCG-1-A-4-1-1,PST=IS-NR,SST=[ALM,ACT],ALIAS=IRA-GE-1000-1::STS1-1,SUPPTTP=1-A-4-1,CRCTYPE=CRC_32,SPICHANNEL=,DEGRADE  
THRESHOLD=1,CONCATIFTYPE=SONET,STSSIZE=STS1,TUNNELPEERTYPE=ETTP,TUNNELPEERNAME=1-A-4-1,MEMBERFAILCRITERIA=PDI_P&DLOM&LOP  
_P&AIS_P,GFPFCSENABLED=YES,DEFAULTJ1ENABLED=NO,LCASENABLED=YES,LCASHOLDOFFTIMER=0,LCASRSACKTIMER=2,CONFIGMONCHANNEL=VCG-  
1-A-4-1-1-CTP-1,ACTUALMONCHANNEL=VCG-1-A-4-1-1-CTP-1,SCRAMBLINGBITENABLED=YES,FRAMINGMODE=GFP,GROUPMEM=1&&21,PROVBW=21,O  
PERBW=21,MAPPERBUFFERALLOCATION=AUTO,MAPPERBUFFERSAVAILABLE=0,EFFIBASESEV=MJ,VCGFAILUREBASESEV=CR"  
   "LABBRFDCOCOREDIRLAB3_IRA-GE-500-1_48_22,PST=IS-NR,SST=[ALM,ACT],ALIAS=IRA-GE-600-1,SUPPTTP=1-A-4-1,CRCTYPE=CRC_32,SP  
ICHANNEL=,DEGRADETHRESHOLD=1,CONCATIFTYPE=SONET,STSSIZE=STS1,TUNNELPEERTYPE=ETTP,TUNNELPEERNAME=1-A-4-2,MEMBERFAILCRITER  
IA=PDI_P&DLOM&LOP_P&AIS_P,GFPFCSENABLED=YES,DEFAULTJ1ENABLED=NO,LCASENABLED=YES,LCASHOLDOFFTIMER=0,LCASRSACKTIMER=2,CONF  
IGMONCHANNEL=LABBRFDCOCOREDIRLAB3_IRA-GE-500-1_48_22-CTP-22,ACTUALMONCHANNEL=LABBRFDCOCOREDIRLAB3_IRA-GE-500-1_48_22-CTP  
-22,SCRAMBLINGBITENABLED=YES,FRAMINGMODE=GFP,GROUPMEM=22&&33,PROVBW=12,OPERBW=12,MAPPERBUFFERALLOCATION=AUTO,MAPPERBUFFE  
RSAVAILABLE=0,EFFIBASESEV=MJ,VCGFAILUREBASESEV=CR"  
   "IRA-GE-1000-4-4500_1-A-4-2_43,PST=IS-NR,SST=[ALM,ACT],ALIAS=,SUPPTTP=1-A-4-2,CRCTYPE=CRC_32,SPICHANNEL=,DEGRADETHRES  
HOLD=21,CONCATIFTYPE=SONET,STSSIZE=STS1,TUNNELPEERTYPE=ETTP,TUNNELPEERNAME=1-A-4-13,MEMBERFAILCRITERIA=PDI_P&DLOM&LOP_P&  
AIS_P,GFPFCSENABLED=YES,DEFAULTJ1ENABLED=NO,LCASENABLED=NO,LCASHOLDOFFTIMER=0,LCASRSACKTIMER=2,CONFIGMONCHANNEL=IRA-GE-1  
000-4-4500_1-A-4-2_43-CTP-43,ACTUALMONCHANNEL=,SCRAMBLINGBITENABLED=YES,FRAMINGMODE=GFP,GROUPMEM=43&&63,PROVBW=21,OPERBW  
=21,MAPPERBUFFERALLOCATION=AUTO,MAPPERBUFFERSAVAILABLE=0,EFFIBASESEV=MJ,VCGFAILUREBASESEV=CR"
iTestterminal
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
PaulD avatar image
PaulD answered PaulD posted

If you have set the mode of the CLI session to TL-1, it will do all of the TL-1 parsing for you automatically.  With this step selected in a test case, open the Structure view and you should see all of the individual items (including the highlighted one) available for analysis.

 

In this case, you are trying to extract a repeating field.  That's probably easy by just choosing the appropriate XPATH query that will fetch all of the matching elements.  If you post the information from the Structure view, we can help by explaining the appropriate XPATH query syntax for you.

6 comments
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ira avatar image ira commented ·

Thanks. I now have the blue boxes. Now I just need to be able to grab those fields and run  a command on each. The number of fields will vary depending on the device I connect to. How do I post the information from the structure view?

0 Likes 0 ·
PaulD avatar image PaulD ira commented ·

You can switch the mode to text view, select all, and paste the text.  It will all be XML and we can review it from there.  Or you could post a screenshot if we can see enough from it.

0 Likes 0 ·
ira avatar image ira PaulD commented ·

I added the text as an attachment.

0 Likes 0 ·
PaulD avatar image PaulD ira commented ·

You are looking for the values of the first parameter in the first subblock of each parameter.  The query you want is, therefore,:

 

//Block/SubBlock[1]/Parameter[1]

 

Since there are many Block tags, this will return the first parameter of the first subblock in each of them.  

 

You might wonder about all of that XML content inside the Parameter elements (parsed into Words, Punctuation, Number, etc.).  You are looking for just the concatentated textual content of the Parameter block, and this query will get you exactly that.  (That sub-structured in the parameters can often be useful, though, when the value of the parameters contains some text that has some structural significance.)

0 Likes 0 ·
ira avatar image ira PaulD commented ·

Thanks. The query works. My analysis rule is putting all of the values into one variable though. How can I use the values in a way that I can run individual commands on each value?

0 Likes 0 ·
ira avatar image ira ira commented ·

A coworker helped my get this with

 

foreach        i ${var1}

 

 

 

Thanks

 

Ira

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.