sampler
To define a sampler and enter the sampler configuration mode, use the sampler command. To remove the sampler definition, use the no form of this command.
sampler name
no sampler name
Syntax Description
name |
Name of the sampler. The name can have a maximum of 63 alphanumeric characters. |
Command Default
No samplers are defined.
Command Modes
Global configuration mode
Command History
Release |
Modification |
---|---|
7.0(0)N1(1) |
This command was introduced. |
Usage Guidelines
NetFlow sampling means that M out of N packets are sampled. When a packet is sampled and there is a NetFlow cache miss, a NetFlow cache entry is created for this flow. The first packet timestamp is updated and the statistics for the first packet are initialized (for example, the bytes are set to the number of bytes in the packet and the packet count is set to one). If there is a NetFlow cache hit when the packet is sampled, the cache for this flow is updated, which includes adding the number of bytes in the packet to the byte counter and incrementing the packet count by one.
Once you enter the sampler name command, you enter the sampler configuration mode, and the prompt changes to the following:
switch(config-flow-sampler)#
Within the sampler configuration mode, the following keywords and arguments are available to configure the flow monitor:
- description description —Provides a description for this sampler; you can add a maximum of 63 characters.
- exit —Exits from the current configuration mode.
- mode
sample-num
out-of
packets —Configures the sampler
mode. The valid values are as follows:
- sample-num —Number of samples per sampling. The range is from 1 to 64.
- out-of —Specifies the samples per packet ratio.
- packets —Number of packets in each sampling. The range is from 1 to 65536, and must be a power of 2.
- no —Negates a command or sets its defaults.
This command does not require a license.
Examples
This example shows how to define a sampler and enter the sampler configuration mode:
switch(config)# sampler testsampler
switch(config-flow-sampler)#
This example shows how to configure the sampler mode:
switch(config)# sampler testsampler
switch(config-flow-sampler)# mode 24 out-of 1024
This example shows how to remove a sampler definition:
switch(config)# no sampler testsampler
switch(config-flow)#