|
NAMEpmapfilter - User-defined labels for IPs and protocol/port pairsSYNOPSISrwfilter --pmap-file=[MAPNAME:]FILENAME [--pmap-file=[MAPNAME:]FILENAME ...] [--pmap-src-MAPNAME=LABELS] [--pmap-dst-MAPNAME=LABELS] [--pmap-any-MAPNAME=LABELS] ... rwcut --pmap-file=[MAPNAME:]FILENAME [--pmap-file=[MAPNAME:]FILENAME ...] --fields=FIELDS [--pmap-column-width=NUM] rwgroup --pmap-file=[MAPNAME:]FILENAME [--pmap-file=[MAPNAME:]FILENAME ...] --id-fields=FIELDS rwsort --pmap-file=[MAPNAME:]FILENAME [--pmap-file=[MAPNAME:]FILENAME ...] --fields=FIELDS rwstats --pmap-file=[MAPNAME:]FILENAME [--pmap-file=[MAPNAME:]FILENAME ...] --fields=FIELDS [--pmap-column-width=NUM] rwuniq --pmap-file=[MAPNAME:]FILENAME [--pmap-file=[MAPNAME:]FILENAME ...] --fields=FIELDS [--pmap-column-width=NUM] DESCRIPTIONPrefix maps provide a mapping from values on a SiLK Flow record to string labels. The binary prefix map file is created from textual input with rwpmapbuild. See the rwpmapbuild(1) manual page for the syntax of input file. This manual page describes how to use a prefix map file to augment the features of some commonly used SiLK applications.A prefix map file maps either an IP address or a protocol/port pair to a label. The mode statement in the input to rwpmapbuild determines whether the prefix map file is a mapping for IPs or for protocol/port pairs. To see the mode of an existing prefix map, use rwpmapcat(1) and specify --output-type=type. When using the prefix map file as described in this manual page, one typically uses the prefix map's map-name. The map-name statement in the input to rwpmapbuild allows one to assign the map-name when creating the prefix map. To see the map-name of an existing prefix map, use rwpmapcat --output-type=mapname. To assign a map-name when loading a prefix map file, use the --pmap-file switch and specify the map-name you want to use, a colon, and the file name. A map-name provided to the --pmap-file switch overrides the map-name in the file (if one exists). When using a prefix map in rwfilter(1), the map-name is combined with the prefix --pmap-src-, --pmap-dst-, or --pmap-any- to create the partitioning switches. When using the prefix map to create fields in rwcut(1), rwgroup(1), rwsort(1), rwstats(1), and rwuniq(1), the map-name must be combined with the prefix "src-" or "dst-" to create the field names. The applications support using multiple prefix map files in a single invocation. When using multiple prefix map files, each file must have a unique map-name (or be assigned a unique map-name on the command line). When a prefix map file does not contain a map-name and no map-name is provided on the command line, SiLK processes the prefix map in legacy mode. When in legacy mode, only one prefix map file may be used. See the "LEGACY" section for details. Three types of prefix map files are currently implemented:
For more information on constructing prefix map files, see the rwpmapbuild(1) documentation. To view the contents, type, or map-name of a prefix map file, use rwpmapcat(1). To map textual input to the labels in a prefix map, use rwpmaplookup(1). OPTIONSThe --pmap-file switch is used to load the prefix map into the application. Use of the prefix map varies by application.To use a prefix map within a supported application, one or more --pmap-file switches are required. Multiple --pmap-file switches are allowed as long as each prefix map is associated with a unique map-name. The switch has two forms:
rwfilter SwitchesWhen using the prefix map in rwfilter(1), the map-name is combined with the prefix --pmap-src-, --pmap-dst-, or --pmap-any- to create the partitioning switches; that is, the switch name depends in part on the map-name of the prefix map.
rwcut, rwgroup, rwsort, rwstats, and rwuniq SwitchesWhen using the prefix map to create fields in rwcut(1), rwgroup(1), rwsort(1), rwstats(1), and rwuniq(1), the map-name must be combined with the prefix "src-" or "dst-" to create the field names. The field names depend in part on the map-name of the prefix map.
LEGACYWhen a prefix map file does not contain a map-name and no map-name is specified in the --pmap-file argument, SiLK processes the prefix map as it did prior to SiLK 2.0, which is called legacy mode. When in legacy mode, only one prefix map file may be used by the application. Legacy mode is deprecated, but it is maintained for backwards compatibility.Legacy SwitchesWhen a prefix map is loaded into rwfilter in legacy mode, the following switches are defined:
Legacy FieldsWhen a prefix map is loaded into rwcut, rwgroup, rwsort, rwstats, or rwuniq in legacy mode, the following fields are made available to the --fields switch:
EXAMPLESIn the following examples, 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.The following examples explicitly specify the map name on the command line, ensuring the examples work any prefix map file. The examples use two prefix map files:
To find today's incoming flow records going to "FineArts": $ rwfilter --type=in,inweb --pmap-file=CMU:carnegiemellon.pmap \ --pmap-dst-CMU="FineArts" --pass=fine-arts-in.rw To find today's outgoing flow records coming from "ChemE": $ rwfilter --type=out,outweb --pmap-file=CMU:carnegiemellon.pmap \ --pmap-src-CMU="ChemE" --pass=cheme-out.rw To find today's internal traffic from "FineArts" to "ChemE": $ rwfilter --type=int2int --pmap-file=CMU:carnegiemellon.pmap \ --pmap-src-CMU="FineArts" --pmap-dst-CMU="ChemE" \ --pass=finearts-to-cheme.rw To find the reverse traffic: $ rwfilter --type=int2int --pmap-file=CMU:carnegiemellon.pmap \ --pmap-src-CMU="ChemE" --pmap-dst-CMU="FineArts" \ --pass=cheme-to-finearts.rw To find today's internal traffic that started or ended at "FineArts" and "ChemE" (this will find traffic between them, as well as traffic they had with any other university department): $ rwfilter --type=int2int --pmap-file=CMU:carnegiemellon.pmap \ --pmap-any-CMU="ChemE,FineArts" \ --pass=cheme-finearts.rw Using the service.pmap file with rwcut to print the label for the protocol/port pairs: $ rwcut --pmap-file=service:service.pmap \ --fields=protocol,dport,dst-service,sport,src-service \ flow-records.rw pro|dPort|dst-service|sPort|src-service| 17| 53| UDP/DNS|29617| UDP| 17|29617| UDP| 53| UDP/DNS| 6| 22| TCP/SSH|29618| TCP| 6|29618| TCP| 22| TCP/SSH| 1| 771| ICMP| 0| ICMP| 17| 67| UDP/DHCP| 68| UDP/DHCP| 6| 443| TCP/HTTPS|28816| TCP| 6|29897| TCP| 25| TCP/SMTP| 6|29222| TCP| 80| TCP/HTTP| 17|29361| UDP| 53| UDP/DNS| Using the service.pmap file with rwuniq: $ rwuniq --pmap-file=serv:service.pmap --fields=dst-serv \ --values=bytes flow-records.rw dst-serv| Bytes| TCP/SSH| 3443906999| TCP/SMTP| 780000305| TCP| 114397570896| TCP/HTTPS| 387741258| TCP/HTTP| 1526975653| UDP/NTP| 1176632| UDP| 14404581| UDP/DHCP| 5121392| UDP/DNS| 3797474| ICMP| 10695328| Using the service.pmap file with rwstats: $ rwstats --pmap-file=srvc:service.pmap --fields=dst-srvc \ --values=bytes --count=5 flow-records.rw INPUT: 501876 Records for 10 Bins and 120571390518 Total Bytes OUTPUT: Top 5 Bins by Bytes dst-srvc| Bytes| %Bytes| cumul_%| TCP| 114397570896| 94.879532| 94.879532| TCP/SSH| 3443906999| 2.856322| 97.735854| TCP/HTTP| 1526975653| 1.266449| 99.002303| TCP/SMTP| 780000305| 0.646920| 99.649223| TCP/HTTPS| 387741258| 0.321586| 99.970809| Using rwsort with two prefix maps, where the records are first sorted by the originating department and then by the service they are requesting: $ rwsort --pmap-file=service:service.pmap \ --pmap-file=cmu:carnegiemellon.pmap \ --fields=src-cmu,dst-service flow-records.rw To see the partitioning switches that a prefix map adds to rwfilter, load the prefix map file prior to specifying the --help switch. $ rwfilter --pmap-file=carnegiemellon.pmap --help \ | sed -n '/^--pmap-/p' To see the fields that a prefix map file adds to rwcut, rwgroup, rwsort, rwstats, or rwuniq, load the prefix map file prior to specifying --help, and then view the description of the --fields switch. $ rwsort --pmap-file=service.pmap --help \ | sed -n '/^--fields/,/^--/p' SEE ALSOrwcut(1), rwfilter(1), rwgroup(1), rwpmapbuild(1), rwpmapcat(1), rwpmaplookup(1), rwsort(1), rwstats(1), rwuniq(1), rwfileinfo(1), silk(7)
Visit the GSP FreeBSD Man Page Interface. |