mirror of
https://github.com/minio/minio.git
synced 2024-12-23 21:55:53 -05:00
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"`
|
||||
}
|
||||
|
||||
// RedisAccessEvent holds event log data and timestamp
|
||||
type RedisAccessEvent struct {
|
||||
Event []event.Event
|
||||
EventTime string
|
||||
}
|
||||
|
||||
// Validate RedisArgs fields
|
||||
func (r RedisArgs) Validate() error {
|
||||
if !r.Enable {
|
||||
@ -185,7 +191,7 @@ func (target *RedisTarget) send(eventData event.Event) error {
|
||||
}
|
||||
|
||||
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 {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user