title: Need to find value that is appearing after particular string using shell script and do the summation
body: <p>I am new to shell scripting and I need to find out a value that is appearing after a particular string using shell script and do the summation.</p>
  
  <p>In my use case, I need to find a particular string from a log file.</p>
  
  <p>Now here, I am having two scenario.</p>
  
  <p><strong>Scenario 1:</strong> "abc" is appearing as single value, i.e., "attribute_1_abc" after that its value which None or any integer value.</p>
  
  <p><strong>Scenario 2:</strong> "abc" is appearing as list, i.e. abc': {'122': 0, '80': 1, 70': 3}
  In this scenario, I need to take the values from list i.e. 0 from '122',
  1 from '80' and so on. </p>
  
  <p>Below is part of logs generated for one record processing and we have multiple such records in log file. </p>
  
  <hr>
  
  <pre><code>None, 'some_value': None}}},'data': {'metrics': {'attribute_1_abc': 12, 'attribute_2_abc': 0, 'abc': {'122': 0, '80': 1, '72': 2}, 'attribute_3_abc': None}}}
  </code></pre>
  
  <p><strong>Expected output:</strong></p>
  
  <p>sum (abc) = value of 'attribute_1_abc' + value of 'attribute_2_abc' + value of 'attribute_3_abc' + sum (abc_list)
   = 12 + 0 + None + 3 = 15</p>
  
  <p>Where sum (abc_list) = 0 + 1 + 2 = 3 </p>