Skip to content

Commit

Permalink
Update humanReadableLogs script
Browse files Browse the repository at this point in the history
Signed-off-by: Mikayla Thompson <[email protected]>
  • Loading branch information
mikaylathompson committed Aug 23, 2023
1 parent ab522c4 commit 2343f2a
Showing 1 changed file with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,32 @@
logger = logging.getLogger(__name__)

LOG_JSON_TUPLE_FIELD = "message"
BASE64_ENCODED_TUPLE_PATHS = ["request.body", "sourceResponse.body", "targetResponse.body"]
BASE64_ENCODED_TUPLE_PATHS = ["sourceRequest.body", "targetRequest.body", "sourceResponse.body", "targetResponse.body"]
# TODO: I'm not positive about the capitalization of the Content-Encoding and Content-Type headers.
# This version worked on my test cases, but not guaranteed to work in all cases.
CONTENT_ENCODING_PATH = {
BASE64_ENCODED_TUPLE_PATHS[0]: "request.Content-Encoding",
BASE64_ENCODED_TUPLE_PATHS[1]: "sourceResponse.Content-Encoding",
BASE64_ENCODED_TUPLE_PATHS[2]: "targetResponse.Content-Encoding"
BASE64_ENCODED_TUPLE_PATHS[0]: "sourceRequest.Content-Encoding",
BASE64_ENCODED_TUPLE_PATHS[1]: "targetRequest.Content-Encoding",
BASE64_ENCODED_TUPLE_PATHS[2]: "sourceResponse.Content-Encoding",
BASE64_ENCODED_TUPLE_PATHS[3]: "targetResponse.Content-Encoding"
}
CONTENT_TYPE_PATH = {
BASE64_ENCODED_TUPLE_PATHS[0]: "request.Content-Type",
BASE64_ENCODED_TUPLE_PATHS[1]: "sourceResponse.Content-Type",
BASE64_ENCODED_TUPLE_PATHS[2]: "targetResponse.Content-Type"
BASE64_ENCODED_TUPLE_PATHS[0]: "sourceRequest.Content-Type",
BASE64_ENCODED_TUPLE_PATHS[1]: "targetRequest.Content-Encoding",
BASE64_ENCODED_TUPLE_PATHS[2]: "sourceResponse.Content-Type",
BASE64_ENCODED_TUPLE_PATHS[3]: "targetResponse.Content-Type"
}
TRANSFER_ENCODING_PATH = {
BASE64_ENCODED_TUPLE_PATHS[0]: "request.Transfer-Encoding",
BASE64_ENCODED_TUPLE_PATHS[1]: "sourceResponse.Transfer-Encoding",
BASE64_ENCODED_TUPLE_PATHS[2]: "targetResponse.Transfer-Encoding"
BASE64_ENCODED_TUPLE_PATHS[0]: "sourceRequest.Transfer-Encoding",
BASE64_ENCODED_TUPLE_PATHS[1]: "targetRequest.Content-Encoding",
BASE64_ENCODED_TUPLE_PATHS[2]: "sourceResponse.Transfer-Encoding",
BASE64_ENCODED_TUPLE_PATHS[3]: "targetResponse.Transfer-Encoding"
}

CONTENT_TYPE_JSON = "application/json"
CONTENT_ENCODING_GZIP = "gzip"
TRANSFER_ENCODING_CHUNKED = "chunked"
URI_PATH = "request.Request-URI"
URI_PATH = "sourceRequest.Request-URI"
BULK_URI_PATH = "_bulk"


Expand Down

0 comments on commit 2343f2a

Please sign in to comment.