collect

Function

The collect command configures the flexible flow statistics sent to the NetStream Collector (NSC) to contain the number of bytes, number of packets, and first and last forwarding time.

The undo collect command configures the flexible flow statistics sent to the NSC not to contain the number of bytes, number of packets, and first and last forwarding time.

By default, the flexible flow statistics sent to the NSC does not contain the number of bytes, number of packets, and first and last forwarding time.

Format

collect { first | last } switched

collect input { packets | bytes } { length }

undo collect { first | last } switched

undo collect input { packets | bytes } [ length ]

Parameters

Parameter Description Value
first

Configures the flexible flow statistics sent to the NSC to contain the first forwarding time.

-

last

Configures the flexible flow statistics sent to the NSC to contain the last forwarding time.

-

switched

Indicates the flexible flow statistics sent to the NSC.

-

input

Configures the flexible flow statistics sent to the NSC to contain the inbound interface information.

-

packets

Configures the flexible flow statistics sent to the NSC to contain the number of packets.

-

bytes

Configures the flexible flow statistics sent to the NSC to contain the number of bytes.

-

length

Specifies the length of the packets and bytes contained in the flexible flow statistics sent to the NSC.

The value can be16, 32, or 64.

Views

NetStream IPv6 record view., NetStream record view

Default Level

3: Management level

Task Name and Operations

Task Name Operations
netstream write

Usage Guidelines

Usage Scenario

To obtain more flow statistics, you can run the collect command to configure the flexible flow statistics output to contain the number of bytes, number of packets, and first and last forwarding time.

Prerequisites

Before you run the collect command, run the ip netstream record or ipv6 netstream record command to create a flexible flow statistics template.

Precautions

The maximum length that the flexible flow statistics template supports is 50 bytes, including the collect and match fields.

Lengths of the collect fields:

  • first: 4 bytes
  • last: 4 bytes
  • packets: 4 bytes
  • bytes: 4 bytes

    Lengths of the match fields:
  • address: 4 bytes for an IPv4 address and 16 bytes for an IPv6 address
  • mask: 1 byte
  • port: 2 bytes
  • vlan: 2 bytes
  • as: 4 bytes
  • mpls top-label ip-address: 4 bytes
  • mpls label 1: 3 bytes
  • mpls label 2: 3 bytes
  • mpls label 3: 3 bytes
  • protocol: 1 byte
  • tos: 1 byte
  • direction: 1 byte
  • tcp-flag: 1 byte
  • input interface: 4 bytes
  • output interface: 4 bytes
  • next-hop: 4 bytes for an IPv4 address and 16 bytes for an IPv6 address
  • bgp next-hop: 4 bytes for an IPv4 address and 16 bytes for an IPv6 address

Example

# Configure the flexible flow statistics sent to the NSC to contain 64-byte number of inbound interface packets.
<HUAWEI> system-view
[~HUAWEI] ip netstream record tt
[*HUAWEI-record-tt] collect input packets 64
[*HUAWEI-record-tt] collect first switched
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >