I have one item with the two possible value of a string.
OK and ERROR,
I need trigger expression with will switch trigger to Problem only when 20 last value is 'ERROR' and will switch to OK only when all 20 last value will be OK.
I was testing with {iteam.count(120,error,"like")}>1 or with regexp but it return 1 at each change occurrence.
Problem only when last 20 values is 'ERROR':
{item.count(#20,error,"like")}>19
Trigger version with hysteresis (switch to OK only when last 20 values will be OK) is left as an exercise for the reader :)
Reference: http://blog.zabbix.com/no-more-flapping-define-triggers-the-smart-way/1488/