func (p *Parser) Flush() LogEvent {
	if !p.inQuery {
		return nil
	}
	event := parseEntry(p.lines)
	p.lines = p.lines[:0]
	return event
}
Flush processes any pending lines and returns a LogEvent if one is complete.
package mysqllog
import (
	"regexp"
	"strconv"
	"strings"
	"time"
)
type LogEvent map[string]interface{}
type Parser struct {
	inHeader bool
	inQuery  bool
	lines    []string
}
func (p *Parser) ConsumeLine(line string) LogEvent {
	if strings.HasPrefix(line, "#") {
		if p.inQuery {
			event := parseEntry(p.lines)
			p.lines = append(p.lines[:0], line)
			p.inQuery = false
			p.inHeader = true
			return event
		}
		p.inHeader = true
		p.lines = append(p.lines, line)
		return nil
	}
	if p.inHeader {
		p.inHeader = false
		p.inQuery = true
		p.lines = append(p.lines, line)
		return nil
	}
	if p.inQuery {
		p.lines = append(p.lines, line)
	}
	return nil
}