title: Parsing snmpwalk output
body: <p>I know here are many questions and answers in regards to parsing snmpwalk response but I cant seem to find the relating answer here. I am not good in parsing texts but I am doing my best to learn things. </p>
  
  <p>I am polling my Juniper device with command: </p>
  
  <pre><code>snmpwalk -v2c -c blablabla x.x.x.x iso.3.6.1.2.1.2.2.1.2
  </code></pre>
  
  <p>Getting response as follow: </p>
  
  <pre><code>iso.3.6.1.2.1.2.2.1.2.2548 = STRING: "xe-4/0/1.3461"
  iso.3.6.1.2.1.2.2.1.2.2549 = STRING: "xe-4/0/2.3462"
  iso.3.6.1.2.1.2.2.1.2.2550 = STRING: "xe-4/0/2.3461"
  iso.3.6.1.2.1.2.2.1.2.2551 = STRING: "xe-4/0/3.3462"
  iso.3.6.1.2.1.2.2.1.2.2552 = STRING: "xe-4/0/3.3461"
  iso.3.6.1.2.1.2.2.1.2.2557 = STRING: "xe-4/2/1.1514"
  iso.3.6.1.2.1.2.2.1.2.2558 = STRING: "xe-4/2/1.1634"
  </code></pre>
  
  <p>Output is ommited as there are many interfaces on this particular device.
  I need to parse through this output so that I can get only physical interfaces. For instance out of string: </p>
  
  <pre><code>iso.3.6.1.2.1.2.2.1.2.2557 = STRING: "xe-4/2/1.1514"
  </code></pre>
  
  <p>I need to extract only xe-4/2/1 and so on with other lines. Basicaly, after character " everything before dot. Please note that there lines like this:</p>
  
  <pre><code>iso.3.6.1.2.1.2.2.1.2.1664 = STRING: "xe-4/3/3"
  iso.3.6.1.2.1.2.2.1.2.1665 = STRING: "xe-4/1/3.534"
  iso.3.6.1.2.1.2.2.1.2.1666 = STRING: "xe-4/1/3.552"
  iso.3.6.1.2.1.2.2.1.2.1667 = STRING: "xe-4/3/0.1613"
  iso.3.6.1.2.1.2.2.1.2.1296 = STRING: "ae2.1464"
  iso.3.6.1.2.1.2.2.1.2.1297 = STRING: "ae2.1503"
  iso.3.6.1.2.1.2.2.1.2.1299 = STRING: "ae2.1596"
  iso.3.6.1.2.1.2.2.1.2.1300 = STRING: "ae2.2020"
  </code></pre>
  
  <p>My final goal is to extract all physical interfaces out of this particular device. The only OID relating to interfaces seems to be iso.3.6.1.2.1.2.2.1.2 and when pooling the device it outputs all interfaces including physical and logical. </p>
  
  <p>Many Thanks</p>