func (m MapStr) GetValue(key string) (interface{}, error) {
	return walkMap(key, m, opGet)
}
GetValue gets a value from the map. If the key does not exist then an error
is returned.
package common
import (
	"encoding/json"
	"fmt"
	"strings"
	"github.com/pkg/errors"
)
const (
	EventMetadataKey = "_event_metadata"
	FieldsKey        = "fields"
	TagsKey          = "tags"
)
var (
	ErrKeyNotFound = errors.New("key not found")
)
type EventMetadata struct {
	Fields          MapStr
	FieldsUnderRoot bool `config:"fields_under_root"`
	Tags            []string
}
type MapStr map[string]interface{}
func (m MapStr) Update(d MapStr) {
	for k, v := range d {
		m[k] = v
	}
}
func (m MapStr) Delete(key string) error {
	_, err := walkMap(key, m, opDelete)
	return err
}
func (m MapStr) CopyFieldsTo(to MapStr, key string) error {
	v, err := walkMap(key, m, opGet)
	if err != nil {
		return err
	}
	_, err = walkMap(key, to, mapStrOperation{putOperation{v}, true})
	return err
}
func (m MapStr) Clone() MapStr {
	result := MapStr{}
	for k, v := range m {
		innerMap, err := toMapStr(v)
		if err == nil {
			result[k] = innerMap.Clone()
		} else {
			result[k] = v
		}
	}
	return result
}
func (m MapStr) HasKey(key string) (bool, error) {
	hasKey, err := walkMap(key, m, opHasKey)
	if err != nil {
		return false, err
	}
	return hasKey.(bool), nil
}