MAN page from CentOS Other silk-common-3.19.1-3.el8.x86_64.rpm


Section: SiLK Tool Suite (1)
Updated: 2021-01-04


rwsiteinfo - Print information from the silk.conf site configuration file 


  rwsiteinfo --fields=FIELD[,FIELD...]        { [--classes=CLASS[,CLASS...]] [--types=TYPE[,TYPE...]]          | [--flowtypes=CLASS/TYPE[,CLASS/TYPE...]] }        [--sensors=SENSOR[,SENSOR...]]        [--data-rootdir=ROOT_DIRECTORY] [--site-config-file=FILENAME]        [--timestamp-format=FORMAT] [--no-titles]        [--no-columns] [--column-separator=CHAR]        [--no-final-delimiter] [{--delimited | --delimited=CHAR}]        [--list-delimiter=CHAR] [--output-path=PATH]        [--pager=PAGER_PROG]  rwsiteinfo --help  rwsiteinfo --help-fields  rwsiteinfo --version


rwsiteinfo is a utility to print selected information about theclasses, types, flowtypes, and sensors that are defined in thesilk.conf(5) site configuration file. The --fields switch isrequired, and its argument is a comma-separated list of field namesselecting the fields to be printed. The output from rwsiteinfoconsists of multiple columns and rows, where each column contains oneof the FIELDs and where each row has a unique value for one of theFIELDs. rwsiteinfo prints rows until all possible combinationsof fields is exhausted. By default, the information is printed in acolumnar, bar ("|") delimited format.

As of SiLK 3.11.0, rwsiteinfo can visit the files in the datarepository to report the date of the earliest (oldest) file in therepository, the date of the latest (most recent) file in therepository, and the number of files in the repository. These valuesare reported individually for each row in the output. Note: Ifyour data repository is large, scanning it may take a long time.

The --classes, --types, --flowtypes, and --sensorsswitches allow the user to limit the amount of information printed.(These switches operate similarly to their namesakes on rwfilter(1)and rwfglob(1).) If none of these switches are given,rwsiteinfo prints information for all values defined in thesilk.conf file. If one or more of these switches is specified,rwsiteinfo limits its output to the specified values. To printinformation about the default class or the default types within aclass, use the at-sign ("@") as the name of the class or type,respectively. The --flowtypes switch must be used independently ofthe --classes and --types switches.

As stated above, rwsiteinfo prints unique rows given a list ofFIELDs. As an example, suppose the user entered the command"rwsiteinfo --fields=class,type,sensor". rwsiteinfo will print arow containing the first class defined in the silk.conf file, thefirst type defined for that class, and the first sensor name definedfor that class/type pair. On the next row, the class and type will bethe same and the second sensor name will be printed. Once all sensorshave been printed, rwsiteinfo repeats the process for the secondtype defined for the first class, and so on. Once all information forthe first class has been printed, the process would repeat for thenext class, until all classes have been printed.

The order of the FIELDs determines how rwsiteinfo iteratesthrough the possible values. The last FIELD will change mostrapidly, and the first field will change most slowly. Two invocationsof rwsiteinfo where the first specifies "--fields=class,sensor"and the second specifies "--fields=sensor,class" produce the samenumber of rows, and each invocation has an outer and inner iterator.In the first invocation, the outer iterator is over the classes, andthe inner iterator is over each sensor defined in that class. In thesecond invocation, the outer iterator is over the sensors, and theinner is over the classes to which that sensor belongs.

In general, the output will contain some combination of class, type,flowtype, and sensor. For flowtype and sensor, the numeric ID may beprinted instead of the name. For class and type, the default valuesmay be printed or they may be identified by a symbol. Most fieldnames support a FIELD:list variant that puts all possible valuesfor that field into a single column. See the description of the--fields switch below for details. 


Option names may be abbreviated if the abbreviation is unique or is anexact match for an option. A parameter to an option may be specifiedas --arg=param or --arg param, though the first form isrequired for options that take optional parameters.
Specify the fields to print as a comma-separated list of names. Thenames are case-insensitive. The fields will be displayed in the orderthe names are specified. The --fields switch is required, andrwsiteinfo will fail when it is not provided.

The list of possible field names is:

the class name, e.g., "all"
the type name, e.g., "inweb"
the flowtype name, e.g., "iw". The flowtype name is a combination ofthe class name and type name, and it is used to name files in the SiLKdata repository.
the integer identifier for the flowtype, e.g., 2
the sensor name, e.g., "S3"
the integer identifier for the sensor, e.g., 3
the sensor description, when present
the default class name
the default type name
a two-character wide column that contains a plus '+' on a row thatcontains the default class and an asterisk '*' on a row thatcontains a default type
the earliest date for a file in the repository that matches the valuesin this row or empty when no files match Since SiLK 3.11.0
the latest date for a file in the repository that matches the valuesin this row or empty when no files match Since SiLK 3.11.0
the number of files in the repository that match the values in thisrow or zero when no files match Since SiLK 3.11.0
instead of printing class names on separate rows, join all the classesin a single row separated using the list-delimiter
instead of printing type names on separate rows, join all the typesin a single row separated using the list-delimiter
instead of printing flowtype names on separate rows, join all theflowtypes in a single row separated using the list-delimiter
instead of printing flowtype identifiers on separate rows, join allthe flowtype identifiers in a single row separated using thelist-delimiter
instead of printing sensor names on separate rows, join all thesensors in a single row separated using the list-delimiter
instead of printing sensor identifiers on separate rows, join all thesensor identifiers in a single row separated using the list-delimiter
equivalent to default-class, but provided for consistency
instead of printing the default type names on separate rows, join allthe default type names in a single row separated using thelist-delimiter
Restrict the output using the class(es) named in the comma-separatedlist. The default class may be specified by using an at-sign ("@")as the name of a class.
Restrict the output using the type(s) named in the comma-separatedlist. The default types for a class may be specified by using anat-sign ("@") as the name of a type.
Restrict the output using the class/type pairs named in thecomma-separated list, where the class name and type name are separatedby a slash ("/"). The keyword "all" may be used for the CLASSand/or TYPE to select all classes and/or types.
Restrict the output to the sensors(s) named in the comma-separatedlist of sensor names, sensor IDs (integers), and/or ranges of sensorIDs.
Use ROOT_DIRECTORY as the root of the data repository, whichoverrides the location given in the SILK_DATA_ROOTDIR environmentvariable, which in turn overrides the location that was compiled intorwsiteinfo (/data). This directory is one of thelocations where rwsiteinfo attempts to find the silk.conf file,and it is the repository that is scanned when the repo-start-date,repo-end-date, or repo-file-count field is specified.
Read the SiLK site configuration from the named file FILENAME.When this switch is not provided, rwsiteinfo searches for the siteconfiguration file in the locations specified in the ``FILES''section.
Specify the format and/or timezone to use when printing timestamps.When this switch is not specified, the SILK_TIMESTAMP_FORMATenvironment variable is checked for a default format and/or timezone.If it is empty or contains invalid values, timestamps are printed inthe default format, and the timezone is UTC unless SiLK was compiledwith local timezone support. FORMAT is a comma-separated list of aformat and/or a timezone. The format is one of:
Print the timestamps as "YYYY/MM/DDThh:mm:ss".
Print the timestamps as "YYYY-MM-DD hh:mm:ss".
Print the timestamps as "MM/DD/YYYY hh:mm:ss".
Print the timestamps as the number of seconds since 00:00:00 UTC on1970-01-01.

When a timezone is specified, it is used regardless of the defaulttimezone support compiled into SiLK. The timezone is one of:

Use Coordinated Universal Time to print timestamps.
Use the TZ environment variable or the local timezone.
Turn off column titles. By default, titles are printed.
Disable fixed-width columnar output.
Use specified character between columns and after the final column.When this switch is not specified, the default of "|" is used.
Do not print the column separator after the final column. Normally adelimiter is printed.
Run as if --no-columns --no-final-delimiter --column-sep=Chad been specified. That is, disable fixed-width columnar output; ifcharacter C is provided, it is used as the delimiter betweencolumns instead of the default "|".
Specify the character to use between items that comprise aFIELD:list column. The default list delimiter is comma ",".
Write the textual output to PATH, where PATH is a filename, anamed pipe, the keyword "stderr" to write the output to the standarderror, or the keyword "stdout" or "-" to write the output to thestandard output (and bypass the paging program). If PATH names anexisting file, rwsiteinfo exits with an error unless theSILK_CLOBBER environment variable is set, in which case PATH isoverwritten. If this switch is not given, the output is either sentto the pager or written to the standard output. Since SiLK 3.15.0.
When output is to a terminal, invoke the program PAGER_PROG to viewthe output one screen full at a time. This switch overrides theSILK_PAGER environment variable, which in turn overrides the PAGERvariable. If the --output-path switch is given or if the value ofthe pager is determined to be the empty string, no paging is performedand all output is written to the terminal.
Print the available options and exit. Options that add fieldscan be specified before --help so that the new options appear inthe output.
Print a description for each field and exit.
Print the version number and information about how SiLK wasconfigured, then exit the application.


In the following examples, the dollar sign ("$") represents the shellprompt. 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. The output from theseexamples is based on the sample silk.conf as distributed for thetwoway site (c.f. packlogic-twoway(3)).

The following prints all known sensor names, one name per line:

 $ rwsiteinfo --fields=sensor --no-titles --delimited S0 S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 S11 S12 S13 S14

The following prints all known sensor names on a single line (thenames will be separated by comma):

 $ rwsiteinfo --fields=sensor:list --no-titles --delimited S0,S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,S14

This changes the output from the previous example to use a space asthe separator:

 $ rwsiteinfo --fields=sensor:list --no-titles --delimited \        --list-delimiter=' ' S0 S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 S11 S12 S13 S14

The following prints the sensor names for the default class on asingle line:

 $ rwsiteinfo --fields=sensor:list --class=@ --no-titles --delimited S0,S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,S14

This shows the numeric sensor IDs:

 $ rwsiteinfo --fields=id-sensor:list                     Sensor-ID:list| 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14|

The following prints four columns: (1) the sensor identifier, (2) thesensor name, (3) the list of classes for that sensor, and (4) adescription of the sensor. This output mimics the output of thedeprecated mapsid(1) tool.

 $ rwsiteinfo --fields=id-sensor,sensor,class:list,describe-sensor Sensor-ID|Sensor|Class:list|                Sensor-Description|         0|    S0|       all|         Description for sensor S0|         1|    S1|       all|                                  |         2|    S2|       all|Optional description for sensor S2|         3|    S3|       all|                                  |         4|    S4|       all|                                  |         5|    S5|       all|                                  |         6|    S6|       all|                                  |         7|    S7|       all|                                  |         8|    S8|       all|                                  |         9|    S9|       all|                                  |        10|   S10|       all|                                  |        11|   S11|       all|                                  |        12|   S12|       all|                                  |        13|   S13|       all|                                  |        14|   S14|       all|                                  |

This prints three columns: the first contains the class, the secondcontains the type, and the third uses a "+" to mark rows for thedefault class and a "*" to mark rows for a default type.

 $ rwsiteinfo --fields=class,type,mark-default Class|   Type|Defaults|   all|     in|      +*|   all|    out|      + |   all|  inweb|      +*|   all| outweb|      + |   all| innull|      + |   all|outnull|      + |   all|int2int|      + |   all|ext2ext|      + |   all| inicmp|      +*|   all|outicmp|      + |   all|  other|      + |

The following prints two columns, the first containing a class nameand the second the list of default types for that class:

 $ rwsiteinfo --fields=class,default-type:list Class|Default-Type:list|   all|  in,inweb,inicmp|

The following prints the default types. (The output contains thedefault type for each class, but twoway site has a single class.)

 $ rwsiteinfo --fields=default-type --no-titles --delimited in inweb inicmp

This does the same (by limiting the output the default types).

 $ rwsiteinfo --fields=type --types=@ --no-titles --delimited all

The following prints the class, the sensor, and the type. The numberof rows of output (excluding the title) is the product of the numberof classes, number of types, and number of sensors.

 $ rwsiteinfo --fields=class,sensor,type Class|Sensor|   Type|   all|    S0|     in|   all|    S0|    out|   all|    S0|  inweb|   all|    S0| outweb|   all|    S0| innull|   all|    S0|outnull|   all|    S0|int2int|   all|    S0|ext2ext|   all|    S0| inicmp|   all|    S0|outicmp|   all|    S0|  other|   all|    S1|     in|   all|    S1|    out| ...   all|   S14|outicmp|   all|   S14|  other|

The repo-start-date, repo-end-date, and repo-file-count fields printthe range of available dates for the files in the repository. Thefollowing shows information about files in the repository for therepository as a whole:

 $ rwsiteinfo --fields=repo-start-date,repo-end-date,repo-file-count          Start-Date|           End-Date|File-Count| 2009/02/12T00:00:00|2009/02/14T23:00:00|      2880|

This breaks down the file information per type:

 $ rwsiteinfo --fields=type,repo-start-date,repo-end-date,repo-file-count    Type|         Start-Date|           End-Date|File-Count|      in|2009/02/12T00:00:00|2009/02/14T23:00:00|       720|     out|2009/02/12T00:00:00|2009/02/14T23:00:00|       720|   inweb|2009/02/12T00:00:00|2009/02/14T23:00:00|       720|  outweb|2009/02/12T00:00:00|2009/02/14T23:00:00|       720|  innull|                   |                   |         0| outnull|                   |                   |         0| int2int|                   |                   |         0| ext2ext|                   |                   |         0|  inicmp|                   |                   |         0| outicmp|                   |                   |         0|   other|                   |                   |         0|

This shows the information for each sensor:

 $ rwsiteinfo --fields=type,repo-start-date,repo-end-date,repo-file-count Sensor|         Start-Date|           End-Date|File-Count|     S0|2009/02/12T00:00:00|2009/02/14T23:00:00|       288|     S1|2009/02/12T00:00:00|2009/02/14T23:00:00|       288|     S2|2009/02/12T00:00:00|2009/02/14T23:00:00|       288|     S3|2009/02/12T00:00:00|2009/02/14T23:00:00|       288|     S4|2009/02/12T00:00:00|2009/02/14T23:00:00|       288|     S5|2009/02/12T00:00:00|2009/02/14T23:00:00|       288|     S6|2009/02/12T00:00:00|2009/02/14T23:00:00|       288|     S7|2009/02/12T00:00:00|2009/02/14T23:00:00|       288|     S8|2009/02/12T00:00:00|2009/02/14T23:00:00|       288|     S9|2009/02/12T00:00:00|2009/02/14T23:00:00|       288|    S10|                   |                   |         0|    S11|                   |                   |         0|    S12|                   |                   |         0|    S13|                   |                   |         0|    S14|                   |                   |         0|


This environment variable is used as the value for--timestamp-format when that switch is not provided. Since SiLK3.11.0.
When set to a non-empty string, rwsiteinfo automatically invokesthis program to display its output a screen at a time. If set to anempty string, rwsiteinfo does not automatically page its output.
When set and SILK_PAGER is not set, rwsiteinfo automaticallyinvokes this program to display its output a screen at a time.
The SiLK tools normally refuse to overwrite existing files. SettingSILK_CLOBBER to a non-empty value removes this restriction.
This environment variable is used as the value for the--site-config-file when that switch is not provided.
This environment variable specifies the root directory of datarepository. As described in the ``FILES'' section, rwsiteinfo mayuse this environment variable when searching for the SiLK siteconfiguration file. In addition, rwsiteinfo visits all the filesin this directory when the repo-start-date, repo-end-date, orrepo-file-count fields are specified in the --fields switch.
This environment variable gives the root of the install tree. Whensearching for configuration files and plug-ins, rwsiteinfo may usethis environment variable. See the ``FILES'' section for details.
When the argument to the --timestamp-format switch includes"local" or when a SiLK installation is built to use the localtimezone, the value of the TZ environment variable determines thetimezone in which rwsiteinfo displays timestamps. (If both ofthose are false, the TZ environment variable is ignored.) If the TZenvironment variable is not set, the machine's default timezone isused. Setting TZ to the empty string or 0 causes timestamps to bedisplayed in UTC. For system information on the TZ variable, seetzset(3) or environ(7). (To determine if SiLK was built withsupport for the local timezone, check the "Timezone support" value inthe output of rwsiteinfo --version.)


Possible locations for the SiLK site configuration file which arechecked when the --site-config-file switch is not provided. Thelocation of the SILK_DATA_ROOTDIR may be specified using the--root-directory switch.
Locations for the root directory of the data repository when the--data-rootdir switch is not specified.


The repo-start-date, repo-end-date, and repo-file-count fields wereadded in SiLK 3.11.0.

rwsiteinfo was added in SiLK 3.0.

rwsiteinfo duplicates the functionality found in mapsid(1).mapsid is deprecated, and it will be removed in the SiLK 4.0release. Examples of using rwsiteinfo in place of mapsid areprovided in the latter's manual page. 


silk.conf(5), mapsid(1), rwfilter(1), rwfglob(1),packlogic-twoway(3), silk(7), tzset(3), environ(7)




This document was created byman2html,using the manual pages.