package main
import (
"context"
"fmt"
"github.com/olivere/elastic/v7"
uuid "github.com/satori/go.uuid"
"log"
"strconv"
"time"
)
const mapping = `
{
"settings":{
"number_of_shards":5,
"number_of_replicas":2
},
"mappings": {
"properties": {
"actionName": {
"type": "keyword"
},
"bucketID": {
"type": "keyword"
},
"clientIP": {
"type": "keyword"
},
"contentLength": {
"type": "long"
},
"injectTime": {
"type": "long"
},
"method": {
"type": "keyword"
},
"nodeID": {
"type": "keyword"
},
"objectHash": {
"type": "keyword"
},
"objectKey": {
"type": "text"
},
"objectName": {
"type": "text"
},
"objectPaths": {
"type": "text"
},
"objectUUID": {
"type": "keyword"
},
"objectVer