3 no need to look for spaces as the numeric conversion will ignore them anyway.
source | link

If the data is always in that format, you could simply write it:

awk -vRS= '$4 == "free" {n+=$7}; END {print n}'

(RS= means records are paragraphs).

Or:

awk -vRS= '/state *= *free/ && match($0, "proc *="procs *"*=") {
  n+=substrn += substr($0,RSTART+RLENGTH)}; END {print n}'

If the data is always in that format, you could simply write it:

awk -vRS= '$4 == "free" {n+=$7}; END {print n}'

(RS= means records are paragraphs).

Or:

awk -vRS= '/state *= *free/ && match($0, "proc *= *") {
  n+=substr($0,RSTART+RLENGTH)}; END {print n}'

If the data is always in that format, you could simply write it:

awk -vRS= '$4 == "free" {n+=$7}; END {print n}'

(RS= means records are paragraphs).

Or:

awk -vRS= '/state *= *free/ && match($0, "procs *=") {
  n += substr($0,RSTART+RLENGTH)}; END {print n}'
2 added 123 characters in body
source | link

If the data is always in that format, you could simply write it:

awk -vRS= '$4 == "free" {n+=$7}; END {print n}'

(RS= means records are paragraphs).

Or:

awk -vRS= '/state *= *free/ && match($0, "proc *= *") {
  n+=substr($0,RSTART+RLENGTH)}; END {print n}'

If the data is always in that format, you could simply write it:

awk -vRS= '$4 == "free" {n+=$7}; END {print n}'

(RS= means records are paragraphs).

If the data is always in that format, you could simply write it:

awk -vRS= '$4 == "free" {n+=$7}; END {print n}'

(RS= means records are paragraphs).

Or:

awk -vRS= '/state *= *free/ && match($0, "proc *= *") {
  n+=substr($0,RSTART+RLENGTH)}; END {print n}'
1
source | link

If the data is always in that format, you could simply write it:

awk -vRS= '$4 == "free" {n+=$7}; END {print n}'

(RS= means records are paragraphs).