func (c *TransferCounter) CompileRegex(operator string) (*regexp.Regexp, error) {
	var r *regexp.Regexp
	var err error
	for _, regionOperator := range regionOperators {
		if operator == regionOperator {
			r, err = regexp.Compile(".*?operator finish.*?region-id=([0-9]*).*?" + operator + ".*?store \\[([0-9]*)\\] to \\[([0-9]*)\\].*?")
		}
	}
	for _, leaderOperator := range leaderOperators {
		if operator == leaderOperator {
			r, err = regexp.Compile(".*?operator finish.*?region-id=([0-9]*).*?" + operator + ".*?store ([0-9]*) to ([0-9]*).*?")
		}
	}
	if r == nil {
		err = errors.New("unsupported operator. ")
	}
	return r, err
}
CompileRegex is to provide regexp for transfer counter.
package analysis
import (
	"bufio"
	"errors"
	"io"
	"log"
	"os"
	"regexp"
	"strconv"
	"time"
)
var regionOperators = []string{"balance-region", "move-hot-read-region", "move-hot-write-region"}
var leaderOperators = []string{"balance-leader", "transfer-hot-read-leader", "transfer-hot-write-leader"}
const DefaultLayout = "2006/01/02 15:04:05"
var supportLayouts = map[string]string{
	DefaultLayout: ".*?([0-9]{4}/[0-9]{2}/[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}).*",
}
type Interpreter interface {
	CompileRegex(operator string) (*regexp.Regexp, error)
	ParseLog(filename string, r *regexp.Regexp) error
}