<< Previous Contents Index Next >>

6.3. Counting and sorting

6.3.1. Adding counters: the counter statement

By default, the reporting module has two counters, packets and bytes for the total packets and bytes for each reported record.

The counter counter type key value ... statement adds an additional counter. The counter parameter is the new counter name, which can be used in output formats in place of packets or bytes. The type parameter can be packets or bytes, indicating whether the counter should accumulate packet or byte counts.

The key and value parameters select the charge records that will be accumulated by this counter. The selection rules are as for the include statement.

An alternate form is counter counter not other-counter ... This creates a counter that accumulates all data that does not match any other-counter. For example, to create counters for web and non-web traffic, one might use:

6.3.2. Sorting output: the sort statement

The sort [+|-]field ... statement causes output records to be sorted by field. Any field can be sorted; counter fields, time_t and elapsed seconds field will be sorted numerically, key and date fields are sorted in ASCII order. A preceding minus sign indicates that the field should be sorted in descending order; a preceding plus sign (or no order character at all) indicates ascending order.

Multiple sort fields may be included.


<< Previous Contents Index Next >>