import re
import snmpy

class log_processor(snmpy.plugin):
    def create(self):
        for k, v in sorted(self.conf['objects'].items()):
            extra = {
                'count': re.compile(v['count']),
                'reset': re.compile(v['reset']) if 'reset' in v else None,
                'start': int(v['start']) if 'start' in v else 0,
            }

            self.data['1.%s' % k] = 'string', v['label']
            self.data['2.%s' % k] = 'integer', extra['start'], extra

        self.tail()

    @snmpy.plugin.task
    def tail(self):
        for line in snmpy.plugin.tail(self.conf['file_name']):
            for item in self.data['2.0':]:
                count = self.data[item:'count'].search(line)
                if count:
                    self.data[item] = self.data[item:True] + (int(count.group(1)) if len(count.groups()) > 0 else 1)
                    break
                if self.data[item:'reset'] is not None and self.data[item:'reset'].search(line):
                    self.data[item] = self.data[item:'start']
                    break

@@ -178,16 +178,17 @@
 'count':
+ 
  re.comp
@@ -228,16 +228,17 @@
 'reset':
+ 
  re.comp
@@ -304,16 +304,17 @@
 'start':
+ 
  int(v%5B'
@@ -346,16 +346,88 @@
 else 0,%0A
+                'rotate': bool(v%5B'rotate'%5D) if 'rotate' in v else False%0A
         
@@ -684,18 +684,258 @@
 e_name'%5D
-):
+, True):%0A            if line is True:%0A                for item in self.data%5B'2.0':%5D:%0A                    if self.data%5Bitem:'rotate'%5D and line is True:%0A                        self.data%5Bitem%5D = self.data%5Bitem:'start'%5D%0A                continue%0A
 %0A       

Add reset on rotation support in log processor.