Private
Server IP : 195.201.23.43  /  Your IP : 3.145.85.212
Web Server : Apache
System : Linux webserver2.vercom.be 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64
User : kdecoratie ( 1041)
PHP Version : 7.1.33-63+ubuntu20.04.1+deb.sury.org+1
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/awscli/examples/ec2/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /lib/python3/dist-packages/awscli/examples/ec2/create-flow-logs.rst
**Example 1: To create a flow log**

The following ``create-flow-logs`` example creates a flow log that captures all rejected traffic for the specified network interface. The flow logs are delivered to a log group in CloudWatch Logs using the permissions in the specified IAM role. ::

    aws ec2 create-flow-logs \
        --resource-type NetworkInterface \
        --resource-ids eni-11223344556677889 \
        --traffic-type REJECT \
        --log-group-name my-flow-logs \
        --deliver-logs-permission-arn arn:aws:iam::123456789101:role/publishFlowLogs

Output::

    {
        "ClientToken": "so0eNA2uSHUNlHI0S2cJ305GuIX1CezaRdGtexample",
        "FlowLogIds": [
            "fl-12345678901234567"
        ],
        "Unsuccessful": []
    }

**Example 2: To create a flow log with a custom format**

The following ``create-flow-logs`` example creates a flow log that captures all traffic for the specified VPC and delivers the flow logs to an Amazon S3 bucket. The ``--log-format`` parameter specifies a custom format for the flow log records. ::

    aws ec2 create-flow-logs \
        --resource-type VPC \
        --resource-ids vpc-00112233344556677 \
        --traffic-type ALL \
        --log-destination-type s3 \
        --log-destination arn:aws:s3:::flow-log-bucket/my-custom-flow-logs/ \
        --log-format '${version} ${vpc-id} ${subnet-id} ${instance-id} ${srcaddr} ${dstaddr} ${srcport} ${dstport} ${protocol} ${tcp-flags} ${type} ${pkt-srcaddr} ${pkt-dstaddr}'

**Example 3: To create a flow log with a one-minute maximum aggregation interval**

The following ``create-flow-logs`` example creates a flow log that captures all traffic for the specified VPC and delivers the flow logs to an Amazon S3 bucket. The ``--max-aggregation-interval`` parameter specifies a maximum aggregation interval of 60 seconds (1 minute). ::

    aws ec2 create-flow-logs \
        --resource-type VPC \
        --resource-ids vpc-00112233344556677 \
        --traffic-type ALL \
        --log-destination-type s3 \
        --log-destination arn:aws:s3:::flow-log-bucket/my-custom-flow-logs/ \
        --max-aggregation-interval 60

For more information, see `VPC Flow Logs <https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs.html>`__ in the *Amazon VPC User Guide*.
Private