Class LogFormat
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
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
Modifier and TypeFieldDescriptionstatic 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
AWS Resource Name (ARN) of the ECS cluster if the traffic is from a running ECS task.static final LogFormat
Name of the ECS cluster if the traffic is from a running ECS task.static final LogFormat
Docker runtime ID of the container if the traffic is from a running ECS task.static final LogFormat
ARN of the ECS container instance if the traffic is from a running ECS task on an EC2 instance.static final LogFormat
ID of the ECS container instance if the traffic is from a running ECS task on an EC2 instance.static final LogFormat
Docker runtime ID of the container if the traffic is from a running ECS task.static final LogFormat
Name of the ECS service if the traffic is from a running ECS task and the ECS task is started by an ECS service.static final LogFormat
ARN of the ECS task if the traffic is from a running ECS task.static final LogFormat
ARN of the ECS task definition if the traffic is from a running ECS task.static final LogFormat
ID of the ECS task if the traffic is from a running ECS task.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
-
Method Summary
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
The AWS account ID of the owner of the source network interface for which traffic is recorded. -
ACTION
The action that is associated with the traffic. -
ALL_DEFAULT_FIELDS
The default format. -
AZ_ID
The ID of the Availability Zone that contains the network interface for which traffic is recorded. -
BYTES
The number of bytes transferred during the flow. -
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
The destination port of the traffic. -
ECS_CLUSTER_ARN
AWS Resource Name (ARN) of the ECS cluster if the traffic is from a running ECS task. -
ECS_CLUSTER_NAME
Name of the ECS cluster if the traffic is from a running ECS task. -
ECS_CONTAINER_ID
Docker runtime ID of the container if the traffic is from a running ECS task.If there is one container or more in the ECS task, this will be the docker runtime ID of the first container.
-
ECS_CONTAINER_INSTANCE_ARN
ARN of the ECS container instance if the traffic is from a running ECS task on an EC2 instance. -
ECS_CONTAINER_INSTANCE_ID
ID of the ECS container instance if the traffic is from a running ECS task on an EC2 instance. -
ECS_SECOND_CONTAINER_ID
Docker runtime ID of the container if the traffic is from a running ECS task.If there is more than one container in the ECS task, this will be the Docker runtime ID of the second container.
-
ECS_SERVICE_NAME
Name of the ECS service if the traffic is from a running ECS task and the ECS task is started by an ECS service. -
ECS_TASK_ARN
ARN of the ECS task if the traffic is from a running ECS task. -
ECS_TASK_DEFINITION_ARN
ARN of the ECS task definition if the traffic is from a running ECS task. -
ECS_TASK_ID
ID of the ECS task if the traffic is from a running ECS task. -
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
The direction of the flow with respect to the interface where traffic is captured. -
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
The ID of the network interface for which the traffic is recorded. -
LOG_STATUS
The logging status of the flow log. -
PACKETS
The number of packets transferred during the flow. -
PKT_DST_ADDR
The packet-level (original) destination IP address for the traffic. -
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
The packet-level (original) source IP address of the traffic. -
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
The IANA protocol number of the traffic. -
REGION
The Region that contains the network interface for which traffic is recorded. -
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
The source port of the traffic. -
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
The ID of the sublocation that contains the network interface for which traffic is recorded. -
SUBLOCATION_TYPE
The type of sublocation that's returned in the sublocation-id field. -
SUBNET_ID
The ID of the subnet that contains the network interface for which the traffic is recorded. -
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
The path that egress traffic takes to the destination. -
TRAFFIC_TYPE
The type of traffic.The possible values are IPv4, IPv6, or EFA.
-
VERSION
The VPC Flow Logs version. -
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
- Parameters:
value
- This parameter is required.
-
-
Method Details
-
custom
A custom format string.Gives full control over the format string fragment.
- Parameters:
formatString
- This parameter is required.
-
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
-