The reason your code may not work is because END case sensitive, so your script will check for the END variable to exist (which is not the case), and therefore the last block will never be executed. If you change this, then it should work.
Also, you do not need a BEGIN block, since the whole variable is created at 0.
Below I have added an alternative way to do this, which you can use instead.
This is similar to glenn, but it only captures the words you want, because of this it should use a little memory.
Using Gawk (for third match argument)
awk 'match($3,/BLOCK|ALLOW/,b){a[b[0]]++}END{for(i in a)print i ,a[i]}' file
This block is executed only if BLOCK or ALLOW contained in the third field.
The match captures what was matched with array b.
Then array a increases for the matched field.
In the END block, each captured field is displayed with an input counter.
Output signal
ALLOW 1 BLOCK 2
user4453924
source share