Class LogFormat

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.ec2.LogFormat
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-12T19:34:00.968Z") @Stability(Stable) public class LogFormat extends software.amazon.jsii.JsiiObject
The following table describes all of the available fields for a flow log record.

Example:

 Vpc vpc = new Vpc(this, "Vpc");
 vpc.addFlowLog("FlowLog", FlowLogOptions.builder()
         .logFormat(List.of(LogFormat.DST_PORT, LogFormat.SRC_PORT))
         .build());
 // If you just want to add a field to the default field
 vpc.addFlowLog("FlowLog", FlowLogOptions.builder()
         .logFormat(List.of(LogFormat.VERSION, LogFormat.ALL_DEFAULT_FIELDS))
         .build());
 // If AWS CDK does not support the new fields
 vpc.addFlowLog("FlowLog", FlowLogOptions.builder()
         .logFormat(List.of(LogFormat.SRC_PORT, LogFormat.custom("${new-field}")))
         .build());
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final LogFormat
    The AWS account ID of the owner of the source network interface for which traffic is recorded.
    static final LogFormat
    The action that is associated with the traffic.
    static final LogFormat
    The default format.
    static final LogFormat
    The ID of the Availability Zone that contains the network interface for which traffic is recorded.
    static final LogFormat
    The number of bytes transferred during the flow.
    static final LogFormat
    The destination address for outgoing traffic, or the IPv4 or IPv6 address of the network interface for incoming traffic on the network interface.
    static final LogFormat
    The destination port of the traffic.
    static final LogFormat
    The time, in Unix seconds, when the last packet of the flow was received within the aggregation interval.
    static final LogFormat
    The direction of the flow with respect to the interface where traffic is captured.
    static final LogFormat
    The ID of the instance that's associated with network interface for which the traffic is recorded, if the instance is owned by you.
    static final LogFormat
    The ID of the network interface for which the traffic is recorded.
    static final LogFormat
    The logging status of the flow log.
    static final LogFormat
    The number of packets transferred during the flow.
    static final LogFormat
    The packet-level (original) destination IP address for the traffic.
    static final LogFormat
    The name of the subset of IP address ranges for the pkt-dstaddr field, if the destination IP address is for an AWS service.
    static final LogFormat
    The packet-level (original) source IP address of the traffic.
    static final LogFormat
    The name of the subset of IP address ranges for the pkt-srcaddr field, if the source IP address is for an AWS service.
    static final LogFormat
    The IANA protocol number of the traffic.
    static final LogFormat
    The Region that contains the network interface for which traffic is recorded.
    static final LogFormat
    The source address for incoming traffic, or the IPv4 or IPv6 address of the network interface for outgoing traffic on the network interface.
    static final LogFormat
    The source port of the traffic.
    static final LogFormat
    The time, in Unix seconds, when the first packet of the flow was received within the aggregation interval.
    static final LogFormat
    The ID of the sublocation that contains the network interface for which traffic is recorded.
    static final LogFormat
    The type of sublocation that's returned in the sublocation-id field.
    static final LogFormat
    The ID of the subnet that contains the network interface for which the traffic is recorded.
    static final LogFormat
    The bitmask value for TCP flags.
    static final LogFormat
    The path that egress traffic takes to the destination.
    static final LogFormat
    The type of traffic.
    static final LogFormat
    The VPC Flow Logs version.
    static final LogFormat
    The ID of the VPC that contains the network interface for which the traffic is recorded.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
    protected
    LogFormat(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    LogFormat(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static LogFormat
    custom(String formatString)
    A custom format string.
    static LogFormat
    field(String field)
    A custom field name.
     

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Field Details

    • ACCOUNT_ID

      @Stability(Stable) public static final LogFormat ACCOUNT_ID
      The AWS account ID of the owner of the source network interface for which traffic is recorded.
    • ACTION

      @Stability(Stable) public static final LogFormat ACTION
      The action that is associated with the traffic.
    • ALL_DEFAULT_FIELDS

      @Stability(Stable) public static final LogFormat ALL_DEFAULT_FIELDS
      The default format.
    • AZ_ID

      @Stability(Stable) public static final LogFormat AZ_ID
      The ID of the Availability Zone that contains the network interface for which traffic is recorded.
    • BYTES

      @Stability(Stable) public static final LogFormat BYTES
      The number of bytes transferred during the flow.
    • DST_ADDR

      @Stability(Stable) public static final LogFormat DST_ADDR
      The destination address for outgoing traffic, or the IPv4 or IPv6 address of the network interface for incoming traffic on the network interface.
    • DST_PORT

      @Stability(Stable) public static final LogFormat DST_PORT
      The destination port of the traffic.
    • END_TIMESTAMP

      @Stability(Stable) public static final LogFormat END_TIMESTAMP
      The time, in Unix seconds, when the last packet of the flow was received within the aggregation interval.

      This might be up to 60 seconds after the packet was transmitted or received on the network interface.

    • FLOW_DIRECTION

      @Stability(Stable) public static final LogFormat FLOW_DIRECTION
      The direction of the flow with respect to the interface where traffic is captured.
    • INSTANCE_ID

      @Stability(Stable) public static final LogFormat INSTANCE_ID
      The ID of the instance that's associated with network interface for which the traffic is recorded, if the instance is owned by you.

      Returns a '-' symbol for a requester-managed network interface; for example, the network interface for a NAT gateway

    • INTERFACE_ID

      @Stability(Stable) public static final LogFormat INTERFACE_ID
      The ID of the network interface for which the traffic is recorded.
    • LOG_STATUS

      @Stability(Stable) public static final LogFormat LOG_STATUS
      The logging status of the flow log.
    • PACKETS

      @Stability(Stable) public static final LogFormat PACKETS
      The number of packets transferred during the flow.
    • PKT_DST_ADDR

      @Stability(Stable) public static final LogFormat PKT_DST_ADDR
      The packet-level (original) destination IP address for the traffic.
    • PKT_DST_AWS_SERVICE

      @Stability(Stable) public static final LogFormat PKT_DST_AWS_SERVICE
      The name of the subset of IP address ranges for the pkt-dstaddr field, if the destination IP address is for an AWS service.
    • PKT_SRC_ADDR

      @Stability(Stable) public static final LogFormat PKT_SRC_ADDR
      The packet-level (original) source IP address of the traffic.
    • PKT_SRC_AWS_SERVICE

      @Stability(Stable) public static final LogFormat PKT_SRC_AWS_SERVICE
      The name of the subset of IP address ranges for the pkt-srcaddr field, if the source IP address is for an AWS service.
    • PROTOCOL

      @Stability(Stable) public static final LogFormat PROTOCOL
      The IANA protocol number of the traffic.
    • REGION

      @Stability(Stable) public static final LogFormat REGION
      The Region that contains the network interface for which traffic is recorded.
    • SRC_ADDR

      @Stability(Stable) public static final LogFormat SRC_ADDR
      The source address for incoming traffic, or the IPv4 or IPv6 address of the network interface for outgoing traffic on the network interface.
    • SRC_PORT

      @Stability(Stable) public static final LogFormat SRC_PORT
      The source port of the traffic.
    • START_TIMESTAMP

      @Stability(Stable) public static final LogFormat START_TIMESTAMP
      The time, in Unix seconds, when the first packet of the flow was received within the aggregation interval.

      This might be up to 60 seconds after the packet was transmitted or received on the network interface.

    • SUBLOCATION_ID

      @Stability(Stable) public static final LogFormat SUBLOCATION_ID
      The ID of the sublocation that contains the network interface for which traffic is recorded.
    • SUBLOCATION_TYPE

      @Stability(Stable) public static final LogFormat SUBLOCATION_TYPE
      The type of sublocation that's returned in the sublocation-id field.
    • SUBNET_ID

      @Stability(Stable) public static final LogFormat SUBNET_ID
      The ID of the subnet that contains the network interface for which the traffic is recorded.
    • TCP_FLAGS

      @Stability(Stable) public static final LogFormat TCP_FLAGS
      The bitmask value for TCP flags.

      • FIN -- 1
      • SYN -- 2
      • RST -- 4
      • SYN-ACK -- 18

      If no supported flags are recorded, the TCP flag value is 0.

      TCP flags can be OR-ed during the aggregation interval. For short connections, the flags might be set on the same line in the flow log record, for example, 19 for SYN-ACK and FIN, and 3 for SYN and FIN.

    • TRAFFIC_PATH

      @Stability(Stable) public static final LogFormat TRAFFIC_PATH
      The path that egress traffic takes to the destination.
    • TRAFFIC_TYPE

      @Stability(Stable) public static final LogFormat TRAFFIC_TYPE
      The type of traffic.

      The possible values are IPv4, IPv6, or EFA.

    • VERSION

      @Stability(Stable) public static final LogFormat VERSION
      The VPC Flow Logs version.
    • VPC_ID

      @Stability(Stable) public static final LogFormat VPC_ID
      The ID of the VPC that contains the network interface for which the traffic is recorded.
  • Constructor Details

    • LogFormat

      protected LogFormat(software.amazon.jsii.JsiiObjectRef objRef)
    • LogFormat

      protected LogFormat(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • LogFormat

      @Stability(Stable) protected LogFormat(@NotNull String value)
      Parameters:
      value - This parameter is required.
  • Method Details

    • custom

      @Stability(Stable) @NotNull public static LogFormat custom(@NotNull String formatString)
      A custom format string.

      Gives full control over the format string fragment.

      Parameters:
      formatString - This parameter is required.
    • field

      @Stability(Stable) @NotNull public static LogFormat field(@NotNull String field)
      A custom field name.

      If there is no ready-made constant for a new field yet, you can use this. The field name will automatically be wrapped in ${ ... }.

      Parameters:
      field - This parameter is required.
    • getValue

      @Stability(Stable) @NotNull public String getValue()