generalized batch/flush

Should work for logstash redis & ES outputs.