Class HttpRequestLogEntry

java.lang.Object
java.util.AbstractMap<String,Object>
java.util.HashMap<String,Object>
net.targetr.rc.monitoring.logs.http.HttpRequestLogEntry
All Implemented Interfaces:
Serializable, Cloneable, Map<String,Object>

public class HttpRequestLogEntry extends HashMap<String,Object>
Represents a log entry for an HTTP request.
See Also:
  • Constructor Details

    • HttpRequestLogEntry

      public HttpRequestLogEntry()
      Constructs a new HTTP request log entry.
  • Method Details

    • getSanitised

      public HttpRequestLogEntry getSanitised()
      Gets a sanitised version of this log entry.
      Returns:
      a sanitised version of this log entry
    • toJson

      public String toJson()
      Serializes this health stat object to a JSON string.
      Returns:
      the JSON representation of this object
    • toCommonLogFormat

      public String toCommonLogFormat()
      Formats this entry as an NCSA Combined Log Format line.

      Format: host - - [dd/MMM/yyyy:HH:mm:ss Z] "method uri version" status bytes "referer" "user-agent"

      Returns:
      the Combined Log Format string
    • sanitize

      public static void sanitize(Map<String,Object> input, Map<String,Object> output)
      Sanitizes a map of header values based on the header key.
      Parameters:
      input - The map of header values
      output - The map to populate with sanitized values
    • sanitize

      public static void sanitize(String key, List<String> input, List<String> output)
      Sanitizes a list of header values based on the header key.
      Parameters:
      key - The header key
      input - The list of header values
      output - The list to populate with sanitized values
    • sanitize

      public static String sanitize(String key, String value)
      Sanitizes a header value based on the header key.
      Parameters:
      key - The header key
      value - The header value
      Returns:
      The sanitized header value
    • sanitizeIpValue

      public static String sanitizeIpValue(String ip)
      Replaces the final number of an IP address string with an asterisk.
      Parameters:
      ip - The input IP address (e.g., "10.0.0.1")
      Returns:
      The masked IP string (e.g., "10.0.0.*")