Port alert for multiple disconnect

Hi,

Is it possible to define a rule that notify by email if a specific port turn off several times in a row ? And not at the first time.

Thanks.