|
NAMEint-ext-fields - SiLK plug-in providing internal/external ip/port fieldsSYNOPSISrwcut --plugin=int-ext-fields.so --fields=FIELDS ... rwgroup --plugin=int-ext-fields.so --fields=FIELDS ... rwsort --plugin=int-ext-fields.so --fields=FIELDS ... rwstats --plugin=int-ext-fields.so --fields=FIELDS ... rwuniq --plugin=int-ext-fields.so --fields=FIELDS ... DESCRIPTIONThe int-ext-fields plug-in adds four potential fields to rwcut (1), rwgroup(1), rwsort(1), rwstats(1), and rwuniq(1). These fields contain the internal IP ("int-ip"), the external IP ("ext-ip"), the internal port ("int-port", and the external port ("ext-port"). To use these fields, specify their names in the --fields switch.These fields can be useful when a file contains flow records that were collected for multiple directions---for example, some flow records are incoming and some are outgoing. For these fields to be available, the user must specify the list of flowtypes (i.e., class/type pairs) that are considered incoming and the list that are considered outgoing. The user must specify the flowtypes because SiLK has no innate sense of the direction of a flow record. Although "in" and "out" are common types, SiLK does not recognize that these represent flows going in opposite directions. If a record has a flowtype that is not in the list of incoming and output flowtypes, the application uses a value of 0 for that field. The user specifies the flowtypes by giving a comma-separated list of class/type pairs using the --incoming-flowtypes and --outgoing-flowtypes switches on the application's command line. When the switch is not provided, the application checks the INCOMING_FLOWTYPES and OUTGOING_FLOWTYPES environment variables. If the list of incoming and/or outgoing flowtypes are not specified, the fields are not available. For the packlogic-twoway(3) site, one would set the following environment variables: INCOMING_FLOWTYPES=all/in,all/inweb,all/inicmp,all/innull OUTGOING_FLOWTYPES=all/out,all/outweb,all/outicmp,all/outnull The parsing of flowtypes requires the silk.conf(5) site configuration file. You may need to set the SILK_CONFIG_FILE environment variable or specify --site-config-file on the command line prior to loading the plug-in. OPTIONSThe int-ext-fields plug-in provides the following options to rwcut, rwgroup, rwsort, rwstats, and rwuniq.
EXAMPLEIn 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.Consider the file data.rw that contains data going in different directions: $ rwcut --fields=sip,sport,dip,dport,proto,class,type data.rw sIP|sPort| dIP|dPort|pro|cla| type| 10.239.86.13|29897|192.168.228.153| 25| 6|all| in| 192.168.228.153| 25| 10.239.86.13|29897| 6|all| out| 192.168.208.237|29416| 10.233.108.250| 25| 6|all| out| 10.233.108.250| 25|192.168.208.237|29416| 6|all| in| 192.168.255.94|29301| 10.198.18.193| 80| 6|all| outweb| 10.198.18.193| 80| 192.168.255.94|29301| 6|all| inweb| 10.202.7.122|29438|192.168.248.202| 25| 6|all| in| 192.168.248.202| 25| 10.202.7.122|29438| 6|all| out| 10.255.142.104|26731|192.168.236.220| 25| 6|all| in| 192.168.236.220| 25| 10.255.142.104|26731| 6|all| out| Using the int-ext-fields plug-in allows one to print the internal and external addresses and ports (note: command line wrapped for improved readability): $ rwcut --plugin=int-ext-fields.so \ --incoming=all/in,all/inweb --outgoing=all/out,all/outweb \ --fields=ext-ip,ext-port,int-ip,int-port,proto,class,type ext-ip|ext-p| int-ip|int-p|pro|cla| type| 10.239.86.13|29897|192.168.228.153| 25| 6|all| in| 10.239.86.13|29897|192.168.228.153| 25| 6|all| out| 10.233.108.250| 25|192.168.208.237|29416| 6|all| out| 10.233.108.250| 25|192.168.208.237|29416| 6|all| in| 10.198.18.193| 80| 192.168.255.94|29301| 6|all| outweb| 10.198.18.193| 80| 192.168.255.94|29301| 6|all| inweb| 10.202.7.122|29438|192.168.248.202| 25| 6|all| in| 10.202.7.122|29438|192.168.248.202| 25| 6|all| out| 10.255.142.104|26731|192.168.236.220| 25| 6|all| in| 10.255.142.104|26731|192.168.236.220| 25| 6|all| out| This can be especially useful when using a tool like rwuniq or rwstats: $ export INCOMING_FLOWTYPES=all/in,all/inweb $ export OUTGOING_FLOWTYPES=all/out,all/outweb $ rwuniq --plugin=int-ext-fields.so \ --fields=int-ip,int-port --value=bytes int-ip|int-p| Bytes| 192.168.208.237|29416| 28517| 192.168.248.202| 25| 4016| 192.168.228.153| 25| 3454| 192.168.236.220| 25| 31872| 192.168.255.94|29301| 14147| Beware of traffic whose type is not listed in INCOMING_FLOWTYPES or OUTGOING_FLOWTYPES $ rwcut --num-rec=4 --fields=sip,sport,dip,dport,proto,type data2.rw sIP|sPort| dIP|dPort|pro| type| 67.215.0.5| 53| 155.6.5.1| 1613| 17|ext2ext| 67.215.0.5| 53| 155.6.5.1| 1895| 17|ext2ext| 67.215.0.5| 53| 155.6.5.1| 1351| 17|ext2ext| 67.215.0.5| 53| 155.6.5.1| 1988| 17|ext2ext| since the int-ext-fields plug-in sets the fields to 0. $ rwcut --num-rec=4 --plugin=int-ext-fields.so \ --incoming=all/in,all/inweb --outgoing=all/out,all/outweb \ --fields=int-ip,int-port,ext-ip,ext-port,proto,type data4.rw int-ip|int-p| ext-ip|ext-p|pro| type| 0.0.0.0| 0| 0.0.0.0| 0| 17|ext2ext| 0.0.0.0| 0| 0.0.0.0| 0| 17|ext2ext| 0.0.0.0| 0| 0.0.0.0| 0| 17|ext2ext| 0.0.0.0| 0| 0.0.0.0| 0| 17|ext2ext| ENVIRONMENT
FILES
SEE ALSOrwcut(1), rwgroup(1), rwsort (1), rwstats(1), rwuniq(1), silk.conf(5), packlogic-twoway(3), silk(7)BUGSThe "int-ip" and "ext-ip" fields do not respect the --ip-format switch nor SILK_IP_FORMAT environment variable. The IP addresses are printed in the canonical format, and the columns are wide enough for an IPv6 address.
Visit the GSP FreeBSD Man Page Interface. |