{
"detail": {
"lastStatus": ["STOPPED"],
"stoppedReason": [{
"anything-but": {
"prefix": ["Task stopped by user", "Scaling activity initiated"]
}
}]
},
"detail-type": ["ECS Task State Change"],
"source": ["aws.ecs"]
}
This configuration works. There is also example in documentation under the Anything-but matching on prefixes section.