| eval View=case(like(publishId,"%U"),"unsubscribed",like(publishId,"%S"),"subscribed")
| transaction startswith="Enter" endswith="Exit" by deviceID View
| table View accountExId deviceID action dateTime eventcount duration
| stats count(deviceID) as count by View
The same search but remove maxpause=300
If you want to append see the other answer regarding append.
You could also do the above and use the duration field that is created by the transaction command. You can use eval and a case statement involving the duration field to creat low, medium, and high values for a field called severity... for example