How to detect invalid login in a rule

Saw this other thread, but no solution was provided. Detect invalid login attempts and lock user in a rule