question

fanfarelogin avatar image
fanfarelogin asked fanfarelogin posted

Response map or any other method, can u pls help with the screen shots

show ip map

 

155.180.43.100, 239.197.1.102) 232.3.1.204 10

(155.180.43.101, 239.197.1.103) 232.3.1.236 10

(155.180.43.102, 239.197.1.104) 232.3.1.296 10

(155.180.38.104, 239.197.1.106) 232.3.1.201 10

i need to grab 232.3.1.204, 232.3.1.236 , 232.3.1.296 and 232.3.1.201 ....

create a list and exeute the following commands

 

sh ip bgp ne 232.3.1.204

 

etc ......

 

How do i do that, it is very simple to do in TCL , but i do not know how to execute the same in Fanfare

 

 

 

iTestresponse map
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

You can use a regex rule right in the step, or use a response map to extract the values.  I'm attaching a sample response map that will pull out the values you highlighted in blue using a pattern map. 

 

In the test case, you can then add a rule that will extract the values by referring to the query for that column.  (If you use a regex rule on the step, then it will automatically find all matches and will produce the same result.)  You use a rule to store those values in a variable.  Then you can use a foreach step to iterate over those values. 

 

I'm also attaching a sample test case that simulates your command using an eval step that uses puts to produce the sample response.  That step refers to the attached response map (which should be stored in the same directory).  The analysis rule on that step extracts all of the matches and stores them in a variable called ip_values.  The following foreach step loops for each value in that list.


ip_map_sample.fftc (2.9 KiB)
show_ip_map.ffrm (2.2 KiB)
10 |950

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

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.