(eventId uint32, req *http.Request)
| 38 | } |
| 39 | |
| 40 | func GetAuditEventData(eventId uint32, req *http.Request) interface{} { |
| 41 | switch eventId { |
| 42 | case AuditDeleteIndexEvent, AuditCreateUpdateIndexEvent: |
| 43 | indexName := rest.IndexNameLookup(req) |
| 44 | d := IndexAuditLog{ |
| 45 | CommonAuditFields: audit.GetCommonAuditFields(req), |
| 46 | IndexName: indexName, |
| 47 | } |
| 48 | return d |
| 49 | case AuditConfigReplanEvent, AuditRunGCEvent, |
| 50 | AuditProfileCPUEvent, AuditProfileMemoryEvent: |
| 51 | return audit.GetCommonAuditFields(req) |
| 52 | case AuditControlEvent: |
| 53 | indexName := rest.IndexNameLookup(req) |
| 54 | d := IndexControlAuditLog{ |
| 55 | CommonAuditFields: audit.GetCommonAuditFields(req), |
| 56 | IndexName: indexName, |
| 57 | Control: rest.RequestVariableLookup(req, "op"), |
| 58 | } |
| 59 | return d |
| 60 | case AuditAccessDeniedEvent: |
| 61 | return IndexAuditLog{ |
| 62 | CommonAuditFields: audit.GetCommonAuditFields(req), |
| 63 | IndexName: rest.IndexNameLookup(req), |
| 64 | } |
| 65 | } |
| 66 | return nil |
| 67 | } |
no outgoing calls
no test coverage detected