diff --git a/agent/pkg/api/main.go b/agent/pkg/api/main.go index 3b74bfa44..81b929469 100644 --- a/agent/pkg/api/main.go +++ b/agent/pkg/api/main.go @@ -110,26 +110,10 @@ func startReadingChannel(outputItems <-chan *tapApi.OutputChannelItem, extension } for item := range outputItems { - fmt.Printf("item: %+v\n", item) extension := extensionsMap[item.Protocol.Name] - fmt.Printf("extension: %+v\n", extension) - // var req *http.Request - // marshedReq, _ := json.Marshal(item.Data.Request.Orig) - // json.Unmarshal(marshedReq, &req) - // var res *http.Response - // marshedRes, _ := json.Marshal(item.Data.Response.Orig) - // json.Unmarshal(marshedRes, &res) - // // NOTE: With this call, the incoming data is sent to the last WebSocket (that the web UI communicates). - // if harEntry, err := models.NewEntry(req, item.Data.Request.CaptureTime, res, item.Data.Response.CaptureTime); err == nil { - // saveHarToDb(harEntry, item.ConnectionInfo) - // } else { - // rlog.Errorf("Error when creating HTTP entry") - // } resolvedSource, resolvedDestionation := resolveIP(item.ConnectionInfo) mizuEntry := extension.Dissector.Analyze(item, primitive.NewObjectID().Hex(), resolvedSource, resolvedDestionation) baseEntry := extension.Dissector.Summarize(mizuEntry) - fmt.Printf("baseEntry: %+v\n", baseEntry) - fmt.Printf("mizuEntry: %+v\n", mizuEntry) mizuEntry.EstimatedSizeBytes = getEstimatedEntrySizeBytes(mizuEntry) database.CreateEntry(mizuEntry) baseEntryBytes, _ := models.CreateBaseEntryWebSocketMessage(baseEntry) diff --git a/tap/api/api.go b/tap/api/api.go index 0c9efea07..6df023f75 100644 --- a/tap/api/api.go +++ b/tap/api/api.go @@ -2,7 +2,6 @@ package api import ( "bufio" - "log" "plugin" "time" ) @@ -77,10 +76,6 @@ type Emitter interface { } func (e *Emitting) Emit(item *OutputChannelItem) { - log.Printf("item: %+v\n", item) - log.Printf("item.Pair: %+v\n", item.Pair) - log.Printf("item.Pair.Request.Payload: %v\n", item.Pair.Request.Payload) - log.Printf("item.Pair.Response.Payload: %v\n", item.Pair.Response.Payload) e.OutputChannel <- item } diff --git a/tap/extensions/amqp/main.go b/tap/extensions/amqp/main.go index 45cf9bbf1..162c61ead 100644 --- a/tap/extensions/amqp/main.go +++ b/tap/extensions/amqp/main.go @@ -200,7 +200,7 @@ func (d dissecting) Dissect(b *bufio.Reader, isClient bool, tcpID *api.TcpID, em } default: - // fmt.Printf("unexpected frame: %+v\n", f) + // log.Printf("unexpected frame: %+v\n", f) } } } @@ -295,7 +295,6 @@ func (d dissecting) Represent(entry string) ([]byte, error) { json.Unmarshal([]byte(entry), &root) representation := make(map[string]interface{}, 0) request := root["request"].(map[string]interface{})["payload"].(map[string]interface{}) - // log.Printf("request: %+v\n", request) var repRequest []interface{} details := request["details"].(map[string]interface{}) switch request["method"].(string) { diff --git a/tap/extensions/http/main.go b/tap/extensions/http/main.go index 1574d9939..b3bed3b0b 100644 --- a/tap/extensions/http/main.go +++ b/tap/extensions/http/main.go @@ -100,8 +100,6 @@ func (d dissecting) Dissect(b *bufio.Reader, isClient bool, tcpID *api.TcpID, em } func (d dissecting) Analyze(item *api.OutputChannelItem, entryId string, resolvedSource string, resolvedDestination string) *api.MizuEntry { - fmt.Printf("pair.Request.Payload: %+v\n", item.Pair.Request.Payload) - fmt.Printf("item.Pair.Response.Payload: %+v\n", item.Pair.Response.Payload) var host string for _, header := range item.Pair.Request.Payload.(map[string]interface{})["headers"].([]interface{}) { h := header.(map[string]interface{}) diff --git a/tap/extensions/http/matcher.go b/tap/extensions/http/matcher.go index d98843a62..fcb7c22b5 100644 --- a/tap/extensions/http/matcher.go +++ b/tap/extensions/http/matcher.go @@ -27,7 +27,6 @@ func createResponseRequestMatcher() requestResponseMatcher { func (matcher *requestResponseMatcher) registerRequest(ident string, request *http.Request, captureTime time.Time) *api.OutputChannelItem { split := splitIdent(ident) key := genKey(split) - // fmt.Printf(">>> request key: %v\n", key) requestHTTPMessage := api.GenericMessage{ IsRequest: true, @@ -57,7 +56,6 @@ func (matcher *requestResponseMatcher) registerRequest(ident string, request *ht func (matcher *requestResponseMatcher) registerResponse(ident string, response *http.Response, captureTime time.Time) *api.OutputChannelItem { split := splitIdent(ident) key := genKey(split) - // fmt.Printf(">>> response key: %v\n", key) responseHTTPMessage := api.GenericMessage{ IsRequest: false, diff --git a/tap/extensions/kafka/matcher.go b/tap/extensions/kafka/matcher.go index e5f2b2e4e..d1875df29 100644 --- a/tap/extensions/kafka/matcher.go +++ b/tap/extensions/kafka/matcher.go @@ -1,7 +1,6 @@ package main import ( - "log" "sync" "time" ) @@ -53,20 +52,3 @@ func (matcher *requestResponseMatcher) preparePair(request *Request, response *R Response: *response, } } - -func (reqResPair *RequestResponsePair) debug() { - req := reqResPair.Request - res := reqResPair.Response - log.Printf( - "\n----------------\n> Request [%d]\nApiKey: %v\nApiVersion: %v\nCorrelationID: %v\nClientID: %v\nPayload: %+v\n> Response [%d]\nCorrelationID: %v\nPayload: %+v\n", - req.Size, - req.ApiKey, - req.ApiVersion, - req.CorrelationID, - req.ClientID, - req.Payload, - res.Size, - res.CorrelationID, - res.Payload, - ) -} diff --git a/tap/extensions/kafka/response.go b/tap/extensions/kafka/response.go index 75f1ff458..119825da9 100644 --- a/tap/extensions/kafka/response.go +++ b/tap/extensions/kafka/response.go @@ -246,8 +246,6 @@ func ReadResponse(r io.Reader, tcpID *api.TcpID, emitter api.Emitter) (err error break } - // reqResPair.debug() - connectionInfo := &api.ConnectionInfo{ ClientIP: tcpID.SrcIP, ClientPort: tcpID.SrcPort,