def parse_function_plugin(logger, line, state):
 try:
  acc = (state['test_acc'] + 1)
 except KeyError:
  acc = 1
 state['test_acc'] = acc
 res = line.split()
 res[2] = acc
 res[3] = {'metric_type': 'counter'}
 return tuple(res)

def parse_function_plugin ( logger , line , state ) : try : acc = ( state [ 'test_acc' ] + 1 ) except KeyError : acc = 1 state [ 'test_acc' ] = acc res = line . split ( ) res [ 2 ] = acc res [ 3 ] = { 'metric_type' : 'counter' } return tuple ( res )
simple stateful parser .