NAME

rwswapbytes - Change the byte order of a SiLK Flow file

SYNOPSIS

  rwswapbytes
        { --big-endian | --little-endian
          | --native-endian | --swap-endian }
        [--note-add=TEXT] [--note-file-add=FILE]
        [INPUT_FILE [OUTPUT_FILE]]

  rwswapbytes --help

  rwswapbytes --version

DESCRIPTION

Read the SiLK Flow records from INPUT_FILE, change the byte order of each record as specified by the --big-endian, --little-endian, --native-endian, or --swap-endian switch, and write the records to OUTPUT_FILE.

rwswapbytes reads the input from the standard input either when no non-switch arguments are given or when INPUT_FILE is the string stdin or -. rwswapbytes writes the output to the standard output either when the number of non-switch arguments is less than two or when OUTPUT_FILE is the string stdout or -.

rwswapbytes exits with an error code if an attempt is made to read or write binary data from or to a terminal.

rwswapbytes is able to read and write files that have been compressed with gzip(1) when the file's name ends with .gz.

OPTIONS

Option names may be abbreviated if the abbreviation is unique or is an exact match for an option. A parameter to an option may be specified as --arg=param or --arg param, though the first form is required for options that take optional parameters.

One of these switches must be provided:

--big-endian

Write the output file in big-endian (network byte-order) format.

--little-endian

Write the output file in little-endian (Intel) format.

--native-endian

Write the output file in this machine's native format.

--swap-endian

Unconditionally swap the byte-order of the input file.

--help

Print the available options and exit.

--version

Print the version number and information about how SiLK was configured, then exit the application.

These switches are optional:

--note-add=TEXT

Add the specified TEXT to the header of the output file as an annotation. This switch may be repeated to add multiple annotations to a file. To view the annotations, use the rwfileinfo(1) tool.

--note-file-add=FILENAME

Open FILENAME and add the contents of that file to the header of the output file as an annotation. This switch may be repeated to add multiple annotations. Currently the application makes no effort to ensure that FILENAME contains text; be careful that you do not attempt to add a SiLK data file as an annotation.

ENVIRONMENT

SILK_CLOBBER

The SiLK tools normally refuse to overwrite existing files. Setting SILK_CLOBBER to a non-empty value removes this restriction.

SILK_CONFIG_FILE

This environment variable contains the location of the site configuration file, silk.conf(5). For additional locations where site configuration file may reside, see the "FILES" section.

SILK_DATA_ROOTDIR

This variable specifies the root of the directory tree where the data store of SiLK Flow files is maintained, overriding the location that is compiled into the tools (/data). rwswapbytes may search for the site configuration file, silk.conf, in this directory. See the "FILES" section for details.

SILK_PATH

This environment variable gives the root of the directory tree where the tools are installed. As part of its search for the site configuration file, rwswapbytes may use this variable. See the "FILES" section for details.

FILES

${SILK_CONFIG_FILE}
${SILK_DATA_ROOTDIR}/silk.conf
/data/silk.conf
${SILK_PATH}/share/silk/silk.conf
${SILK_PATH}/share/silk.conf
/usr/share/silk/silk.conf
/usr/share/silk.conf

Possible locations for the SiLK site configuration file.

SEE ALSO

rwfileinfo(1), silk.conf(5), silk(7), gzip(1)

NOTES

Prior to SiLK 3.16.0, rwswapbytes required explicit arguments for the input file and the output file.