I have set the key on a bunch of alarms to be %n_%4 which in theory means a trap==>event==>Alarm should increase the count when the same trap from the same node comes in. For one particular message I get, it is not working - I get a new alarm every time. 
The value of %4 is 247 chars as per below.
I have tried different variations at the start of the key of which I can see that, every time, the value in the KEY field gets truncated every time to 256 chars - and count does not go up.
It would not be so bad if the truncated field key was compared as that would be enough to match - but for some reason, it is not.
I exported the keys from Alarm Log view into a csv - pasted them into notepad ++ - ran compare - both keys were the same.

The value of %4 is 247 chars as per below.
Code Select
Warning [21/06/2019 BT2 3, 21/06/2019 BT6 3, 21/06/2019 BT6 12, 21/06/2019 BT7 5] - Failed to retrieve image: 'RISA Harness image /8557', exception: The remote server returned an error: (550) File unavailable (e.g., file not found, no access).I have tried different variations at the start of the key of which I can see that, every time, the value in the KEY field gets truncated every time to 256 chars - and count does not go up.
It would not be so bad if the truncated field key was compared as that would be enough to match - but for some reason, it is not.
I exported the keys from Alarm Log view into a csv - pasted them into notepad ++ - ran compare - both keys were the same.