Skip to content

Commit

Permalink
Fixed the wrong body format for logging to Splunk
Browse files Browse the repository at this point in the history
  • Loading branch information
pajama-coder committed Nov 27, 2024
1 parent 90dd597 commit 6b85ba2
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions agent/apps/ztm/proxy/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,17 @@ export default function ({ app, mesh }) {
.handleMessageEnd(
(msg) => {
currentLogger?.log?.({
time: $requestTime.toUTCString(),
username: $ctx.peer.username,
endpoint: $ctx.peer.id,
ip: $ctx.peer.ip,
target: $target,
method: $requestHead.method,
path: $requestHead.path,
headers: $requestHead.headers,
size: msg.tail.headSize + msg.tail.bodySize,
event: {
time: $requestTime.toUTCString(),
username: $ctx.peer.username,
endpoint: $ctx.peer.id,
ip: $ctx.peer.ip,
target: $target,
method: $requestHead.method,
path: $requestHead.path,
headers: $requestHead.headers,
size: msg.tail.headSize + msg.tail.bodySize,
}
})
}
)
Expand Down

0 comments on commit 6b85ba2

Please sign in to comment.