Encode will encode categorical values and normalize according to configuration
()
| 183 | |
| 184 | // Encode will encode categorical values and normalize according to configuration |
| 185 | func (h *HTTP) Encode() []string { |
| 186 | return filter([]string{ |
| 187 | httpEncoder.Int64(fieldTimestamp, h.Timestamp), |
| 188 | httpEncoder.String(fieldProto, h.Proto), |
| 189 | httpEncoder.String(fieldMethod, h.Method), |
| 190 | httpEncoder.String(fieldHost, h.Host), |
| 191 | httpEncoder.String(fieldUserAgent, h.UserAgent), |
| 192 | httpEncoder.String(fieldReferer, h.Referer), |
| 193 | // TODO: flatten |
| 194 | //join(reqCookies...), |
| 195 | //join(resCookies...), |
| 196 | httpEncoder.Int32(fieldReqContentLength, h.ReqContentLength), |
| 197 | httpEncoder.String(fieldURL, h.URL), |
| 198 | httpEncoder.Int32(fieldResContentLength, h.ResContentLength), |
| 199 | httpEncoder.String(fieldContentType, h.ContentType), |
| 200 | httpEncoder.Int32(fieldStatusCode, h.StatusCode), |
| 201 | httpEncoder.String(fieldSrcIP, h.SrcIP), |
| 202 | httpEncoder.String(fieldDstIP, h.DstIP), |
| 203 | httpEncoder.Int32(fieldSrcPort, h.SrcPort), |
| 204 | httpEncoder.Int32(fieldDstPort, h.DstPort), |
| 205 | httpEncoder.String(fieldReqContentEncoding, h.ReqContentEncoding), |
| 206 | httpEncoder.String(fieldResContentEncoding, h.ResContentEncoding), |
| 207 | httpEncoder.String(fieldServerName, h.ServerName), |
| 208 | httpEncoder.String(fieldFlow, h.Flow), |
| 209 | httpEncoder.String(fieldJa4h, h.Ja4H), |
| 210 | }) |
| 211 | } |
| 212 | |
| 213 | // Analyze will invoke the configured analyzer for the audit record and return a score. |
| 214 | func (h *HTTP) Analyze() {} |