In the following example, the dollar sign ($) represents the shell
prompt. The text after the dollar sign represents the command line.
Lines have been wrapped for improved readability, and the back slash
(\) is used to indicate a wrapped line.
Suppose in addition to the default fields of 1-12 produced by rwcut(1), you
want to prefix each row with an integer form of the destination
IP and the start time to make processing by another tool (e.g., a
spreadsheet) easier. However, within the default rwcut output
fields of 1-12, you want to see dotted-decimal IP addresses. You
could use the following command:
$ rwfilter ... --pass=stdout \
| rwcut --fields=dip,stime,1-12 --ip-format=decimal \
| num2dot --ip-field=3,4
In the rwcut invocation, you prepend the fields of interest (dip
and stime before the standard fields. The first six columns
produced by rwcut will be dIP, sTime, sIP, dIP, sPort, dPort. The
--ip-format switch causes the first, third, and fourth columns to
be printed as integers, but you only want the first column to have an
integer representation. The pipe through num2dot will convert the
third and fourth columns to dotted-decimal IP numbers.