NAME
ftimes-dig2dbi.pl - Preprocess FTimes dig data for MySQL DB import
SYNOPSIS
ftimes-dig2dbi.pl [-D {default|ignore|replace}] [-d db] [-h host] [-m max-rows] [-o option[,option[,...]]] [-t table] -f {file|-}
DESCRIPTION
This utility takes FTimes dig data as input, processes it, and produces two output files having the extensions .sql and .dbi. The SQL statements in the .sql file may be used to import the .dbi data into MySQL -- dbi is short for DB Import. An extra field, joiner, is added to the .dbi file. This field serves as the primary index -- either alone or in conjunction with the hostname field. It can also be used as a joining key to tie map and dig tables together.
OPTIONS
- -D {default|ignore|replace}
-
Add the IGNORE or REPLACE keyword to the LOAD statement. The default value is 'default', which means don't alter the LOAD statement.
- -d db
-
Specifies the name of the database to create/use. This value is passed directly into the .sql file. The default value is 'ftimes'.
- -f {file|-}
-
Specifies the name of the input file. A value of '-' will cause the program to read from stdin. If input is read from stdin, the output files will be placed in the current directory and have a basename of 'stdin'.
- -h host
-
Specifies the name of the host to bind to the imported data. If specified, an additional field, hostname, is inserted in the .dbi file and filled with the appropriate value. By default, the hostname field is not used.
- -m max-rows
-
Limits the number of records that may be inserted into the specified database. This value is passed directly into the .sql file as MAX_ROWS.
- -o option,[option[,...]]
-
Specifies the list of options to apply. Currently, the following options are supported:
- ForceWrite
-
Force existing .sql and .dbi files to be truncated on open.
- LocalInFile
-
Add the LOCAL keyword to the LOAD statement. When this keyword is specified, the .dbi file is read by the local MySQL client and sent to the remote MySQL server.
- UseMergeTables
-
Append the hostname, if defined, as a suffix on the table name. This allows data for each unique host to be loaded into separate tables that can be linked together using MySQL MERGE tables.
- -t table
-
Specifies the name of the table to create/use. This value is passed directly into the .sql file. The default value is 'dig'.
CAVEATS
Don't mix host and non host .dbi files as they use different schemas.
AUTHOR
Klayton Monroe
SEE ALSO
ftimes(1)
LICENSE
All documentation and code are distributed under same terms and conditions as FTimes.
|