func flattenCloudTrailRecord(r *CloudTrailRecord) map[string]interface{} {
	p := make(map[string]interface{}, 0)
	p["Type"] = r.UserIdentity.Type
	p["PrincipleId"] = r.UserIdentity.PrincipleId
	p["ARN"] = r.UserIdentity.ARN
	p["AccountId"] = r.UserIdentity.AccountId
	p["AccessKeyId"] = r.UserIdentity.AccessKeyId
	p["EventTime"] = r.EventTime
	p["EventName"] = r.EventName
	p["EventSource"] = r.EventSource
	p["AwsRegion"] = r.AwsRegion
	p["SourceIPAddress"] = r.SourceIPAddress
	p["UserAgent"] = r.UserAgent
	p["EventType"] = r.EventType
	p["Parameters"] = r.RequestParameters
	return p
}
Helper function for flattening cloud trail records
honeytail events are map[string]interface{}
package publisher
import (
	"compress/gzip"
	"encoding/json"
	"fmt"
	"io"
	"math/rand"
	"os"
	"time"
	dynsampler "github.com/honeycombio/dynsampler-go"
	"github.com/honeycombio/honeyaws/options"
	"github.com/honeycombio/honeyaws/sampler"
	"github.com/honeycombio/honeyaws/state"
	"github.com/honeycombio/honeytail/event"
	"github.com/sirupsen/logrus"
)
type CloudTrailResource struct {
	ResourceARN       string `json:"ARN"`
	ResourceAccountId string `json:"accountId"`
}
type CloudTrailUserIdentity struct {
	Type        string `json:"type"`
	PrincipleId string `json:"principleId"`
	ARN         string `json:"arn"`
	AccountId   string `json:"accountId"`
	AccessKeyId string `json:"accessKeyId"`
}
type CloudTrailRecords struct {
	Records []CloudTrailRecord `json:"Records"`
}
type CloudTrailRecord struct {
	UserIdentity      CloudTrailUserIdentity `json:"userIdentity"`
	EventTime         string                 `json:"eventTime"`
	EventSource       string                 `json:"eventSource"`
	EventName         string                 `json:"eventName"`
	AwsRegion         string                 `json:"awsRegion"`
	SourceIPAddress   string                 `json:"sourceIPAddress"`
	UserAgent         string                 `json:"userAgent"`
	Resources         []CloudTrailResource   `json:"resources"`
	EventType         string                 `json:"eventType"`
	RequestParameters map[string]interface{} `json:"requestParameters"`
}
type CloudTrailEventParser struct {
	sampler dynsampler.Sampler
}