mirror of https://github.com/minio/minio.git
Simplify redis access event format to faciliate parsing (#9046)
This commit is contained in:
parent
6f66f1a910
commit
5b8975bf4b
|
@ -61,6 +61,12 @@ type RedisArgs struct {
|
||||||
QueueLimit uint64 `json:"queueLimit"`
|
QueueLimit uint64 `json:"queueLimit"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RedisAccessEvent holds event log data and timestamp
|
||||||
|
type RedisAccessEvent struct {
|
||||||
|
Event []event.Event
|
||||||
|
EventTime string
|
||||||
|
}
|
||||||
|
|
||||||
// Validate RedisArgs fields
|
// Validate RedisArgs fields
|
||||||
func (r RedisArgs) Validate() error {
|
func (r RedisArgs) Validate() error {
|
||||||
if !r.Enable {
|
if !r.Enable {
|
||||||
|
@ -185,7 +191,7 @@ func (target *RedisTarget) send(eventData event.Event) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if target.args.Format == event.AccessFormat {
|
if target.args.Format == event.AccessFormat {
|
||||||
data, err := json.Marshal([]interface{}{eventData.EventTime, []event.Event{eventData}})
|
data, err := json.Marshal([]RedisAccessEvent{{Event: []event.Event{eventData}, EventTime: eventData.EventTime}})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue