mirror of
https://github.com/minio/minio.git
synced 2025-01-26 14:13:16 -05:00
Event Notification for ElasticSearch (#6764)
Using access format for Event Notification for Elastic Search
This commit is contained in:
parent
bdea19b583
commit
572719872d
@ -22,7 +22,6 @@ import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/minio/minio/pkg/event"
|
||||
xnet "github.com/minio/minio/pkg/net"
|
||||
@ -85,13 +84,7 @@ func (target *ElasticsearchTarget) Send(eventData event.Event) (err error) {
|
||||
}
|
||||
|
||||
add := func() error {
|
||||
eventTime, err := time.Parse(event.AMZTimeFormat, eventData.EventTime)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
eventTimeMS := fmt.Sprintf("%d", eventTime.UnixNano()/1000000)
|
||||
_, err = target.client.Index().Index(target.args.Index).Type("event").Timestamp(eventTimeMS).BodyJson(map[string]interface{}{"Records": []event.Event{eventData}}).Do(context.Background())
|
||||
_, err = target.client.Index().Index(target.args.Index).Type("event").BodyJson(map[string]interface{}{"Records": []event.Event{eventData}}).Do(context.Background())
|
||||
return err
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user