title: how to write bash script to filter some data in logs
body: <p>I have a log file in this format.</p>
  
  <pre><code>-----------------------------------------------------------
  name=abc
  address=country:US,Zip:12345/1,city:ny/1,state:ny/1, yearsLived:5/1,other details
  healthDetails=healthplan:medixx/1, expensesInDollars:150/1, other details
  -----------------------------------------------------------
  
  name=xyz
  address=country:US,Zip:12345/1,city:ny/1,state:ny/1, yearsLived:3/1,other details
  healthDetails=healthplan:medixx/1, expensesInDollars:150/1, other details
  -----------------------------------------------------------
  
  name=awd
  address=country:US,Zip:12345/1,city:ny/1,state:ny/1, yearsLived:2/1,other details
  healthDetails=healthplan:medixx/1, expensesInDollars:150/1, other details
  -----------------------------------------------------------
  </code></pre>
  
  <p>I want to extract the name of the person and years lived if years lived are greater than certain years(say 2) for each name in the log file. The file will have duplicate names too with different details.</p>
  
  <p>Output:</p>
  
  <pre><code>name:abc
  yearLived:5
  name:xyz
  yearsLived: 3
  </code></pre>
  
  <p>I was trying to use the grep and cut commands to do that. The problem I am facing is that once I do grep or cut I lose the other part i.e. either name or address. How do I resolve this? </p>