func (h LogHook) Run(e *zerolog.Event, level zerolog.Level, msg string) {
	h.metric.RecordByLogTypes(level.String())
	e.Str("version", Version)
}
LogHook to send a graphite metric for each log entry
package main
import (
	"bufio"
	"crypto/rand"
	"io"
	"io/ioutil"
	"os"
	"os/signal"
	"path/filepath"
	"regexp"
	"strings"
	"sync"
	"time"
	goMetrics "github.com/rcrowley/go-metrics"
	"github.com/rs/zerolog"
	"github.com/spf13/afero"
	"github.com/spf13/cobra"
	"github.com/spf13/viper"
	bolt "go.etcd.io/bbolt"
	"github.com/bookingcom/bpfink/pkg"
)
var (
	BuildDate          = "(development)"
	Version            string
	MetricsInitialised struct {
		metrics *pkg.Metrics
		err     error
		Once    sync.Once
	}
)
type (
	Configuration struct {
		Debug         bool
		Level         string
		Database      string
		Keyfile       string
		key           []byte
		BCC           string `mapstructure:"bcc"`
		MetricsConfig struct {
			GraphiteHost       string
			GraphiteMode       int
			NameSpace          string
			CollectionInterval time.Duration
			HostRolePath       string
			HostRoleKey        string
			HostRoleToken      string
		}
		Consumers struct {
			Root        string
			Access      string
			GenericDiff []string
			Users       struct {
				Shadow, Passwd string
			}
			Generic  []string
			Excludes []string
		}
	}
	FileInfo struct {
		File  string
		IsDir bool
	}
	LogHook struct {
		metric *pkg.Metrics
	}
)
const (
	DefaultConfigFile = "/etc/bpfink.toml"
	DefaultDatabase       = "/var/lib/bpfink.db"
	puppetFileColumnCount = 2
	keySize               = 16
)