Reply
Member
mckay
Posts: 4
Registered: 04-14-2010
0
Accepted Solution

Help with response map!

Hi,

 

I have the attached response map that I am trying to create. I have the following problem when i create the blokc response map.

 

  1. why i saw the error message in the Samples page.
  2. How can i get the multiple token in block responce map, for example, get the interface name from "via xe-11/1/0"

 

Manyt thanks for your help.

Fanfare
YujieL
Posts: 187
Registered: 09-03-2008
0

Re: Help with response map!

[ Edited ]

One of the problems is that your neighbor block appears multiple times, but for the block properties, you did not check "This block may appear multiple times"

You need to check it.

 

The next problem is that on the last line of your neighbor block, you're expecting "Secondary Tables: alex_", but the second time that this block appears in your response, that line became "Secondary Tables: Robin" .  You need to make that word in your block to allow any content.  But after trying that, I am seeing more errors, because there are other subtle things that differ between the first block and the second block in your response.  This can get real tricky if you're trying to use one block to map to repeated blocks in your response.

 

You might be better off with pattern mapping if you only care about one specific token in the response.

Member
mckay
Posts: 4
Registered: 04-14-2010
0

Re: Help with response map!

Hi YujieL,

 

Thanks for your clarification, because of the same format appear many times, so i choosed the block mapping.

 

And i want to get the route distinguisher , route target, as paht and nexthop interface from the attached response. But they all had been split by some characters. Is there a way to set the "xe-11/0/0.16" to one token in the block mapping?

 

Fanfare
PatrickH
Posts: 162
Registered: 09-10-2008
0

Re: Help with response map!

You can define a custom parser that will match tokens of that form and they will then show up as one token instead of being split up.

 

To do this, switch to the custom parsers tab, define a new one with a regular expression that will match this type of token. Then switch back to your block maps, and click on the reparse blocks button to have iTest reparse your blocks with the new parsers.

Expert
KumarS
Posts: 2,233
Registered: 08-30-2008
0

Re: Help with response map!

Another trick to make that as one token is to use "wild card token". what you can do is to replace the string:

 

xe-11/0/0/16 in your block with interface

 

Now you can select the "interface" as a token and set the property "wildcard" and give it a name. This technique does not need a custom parser to be built.