Hello everyone,<br><br>The rules I wrote are <br><br><br>rule &quot;Test 1 Rule&quot;<br>&nbsp;&nbsp; &nbsp;salience 1000<br>&nbsp;&nbsp; &nbsp;when<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">&nbsp;Line ( $admin : line)</span><br style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;eval ( $admin.matches(&quot;^.*@\\S*[#&gt;]\\s*show\\s+interface[s]*\\s*$&quot;))</span><br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Line ( $lineSecond : line)<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;eval ( $lineSecond.matches(&quot;^\\s*(\\S+)\\s+is\\s+(up|down|administratively down),\\s*line\\s+protocol\\s+is\\s+(up|down)\\s*$&quot;))
<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;device : Device()<br>&nbsp;&nbsp; &nbsp;then<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println(&quot;********************************************&quot;);<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;device.setVendorType(&quot;Foundry&quot;);<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br>end<br><br>rule &quot;Juniper Show Interface CanIParse() Rule&quot;
<br>&nbsp;&nbsp; &nbsp;salience 5000<br>&nbsp;&nbsp; &nbsp;<br>&nbsp;&nbsp; &nbsp;when<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Line ( $regex : line)<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;eval ( $regex.matches(&quot;^.*@\\S*[#&gt;]\\s*show\\s+interface[s]*\\s*$&quot;))<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Line ( $lineStr : line)<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;eval ( $lineStr.matches(&quot;^.*\\s*Physical\\s+interface:\\s*([^,\\s]+),\\s+([^,]+),.*$&quot;)) 
<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;device : Device()<br>&nbsp;&nbsp; &nbsp;then<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println(&quot;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&quot;);<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;device.setVendorType(&quot;Juniper&quot;);<br>end<br><br><br>Basically the rules are searching for two regular expressions, of which one is same for the both of the 
rules.But when i write the rules like the above<br>I do not get the correct o/p, but however if i change my rules to (bold) as below, I get the correct output.So is it necessary the the declaration has<br>to be same if the both the rules have same regex
<br><br>rule &quot;Test 1 Rule&quot;<br>
&nbsp;&nbsp; &nbsp;salience 1000<br>
&nbsp;&nbsp; &nbsp;when<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<span style="font-weight: bold;">Line ( $regex : line)</span><br style="font-weight: bold;"><span style="font-weight: bold;">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;eval ( $regex.matches(&quot;^.*@\\S*[#&gt;]\\s*show\\s+interface[s]*\\s*$&quot;</span>))<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Line ( $lineSecond : line)<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;eval (
$lineSecond.matches(&quot;^\\s*(\\S+)\\s+is\\s+(up|down|administratively
down),\\s*line\\s+protocol\\s+is\\s+(up|down)\\s*$&quot;))<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;device : Device()<br>
&nbsp;&nbsp; &nbsp;then<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println(&quot;********************************************&quot;);<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;device.setVendorType(&quot;Foundry&quot;);<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br>
end<br>
<br>
rule &quot;Juniper Show Interface CanIParse() Rule&quot;<br>
&nbsp;&nbsp; &nbsp;salience 5000<br>
&nbsp;&nbsp; &nbsp;<br>
&nbsp;&nbsp; &nbsp;when<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Line ( $regex : line)<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;eval ( $regex.matches(&quot;^.*@\\S*[#&gt;]\\s*show\\s+interface[s]*\\s*$&quot;))<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Line ( $lineStr : line)<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;eval ( $lineStr.matches(&quot;^.*\\s*Physical\\s+interface:\\s*([^,\\s]+),\\s+([^,]+),.*$&quot;)) <br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;device : Device()<br>
&nbsp;&nbsp; &nbsp;then<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println(&quot;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&quot;);<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;device.setVendorType(&quot;Juniper&quot;);<br>
end<br><br>Thanks<br>Shiva<br>