Could you please suggest if there is any way to pick a single word for comparision from command output string. Below is the command and its output. VS1#show ip bgp vpnv4 vrf 40 neighbors 172.17.7.2 | in BGP state BGP state = Established, up for 3w3d I have applied analysis rule to store the output in a variable 'bgpState' using regEx :: ^\s+BGP state =\s+([^\r\n]+)$ For this particular example ablove 'bgpState' variable contains 'Established, up for 3w3d' Is there any way to pick only word 'Established' from 'bgpState' variable. I want to apply 'if' structure as if bgpState == "Established" This is required because BGP state may be down/active and also up/down for hours/days/weeks Thank you in advanced.
Select the **BGP state** value and add a **Quick Analysis Rule** as shown in the below screenshot. ![alt text] : /storage/temp/3777-analysisrule.jpg Here the variable $value stores the state of BGP and compares it with the string "Established". If the BGP state is otherthan Established, this analysis rule gets fail.
This is another way to achieve this. We could also create a pattern response map and create a query for the "Established" word, then using this query we could store the word in a variable as Analysis rule >Query against the response data >store the extracted data in a variable. Attached is the response map for your reference[link text]. In order to use this response map go to step properties of the required step in the test case, then Other post processing > Select the Expected Response map option > Browse the Response map. Thanks! : /storage/temp/3728-response.ffrm