Dump Command
Introduction
The ips dump command allows users to export data from IP database files to plain text files for data analysis or other processing. This command supports multiple database formats and allows for customization of the output data fields.
Usage
The ips dump command can be used to specify input files, input formats, export fields, and other options to perform data export operations.
Command Syntax
ips dump -i inputFile [--input-format] [-o outputFile] [flags]-i, --input-file string:Specifies the path to the input IP database file. Required.--input-format string:Specifies the format of the input IP database file. Default is auto-detection.--input-option string:Specifies options for the database reader. For more information, refer to the database documentation.--hybrid-mode string: Specifies the operational mode for the Hybrid Reader. Options arecomparisonandaggregation. For more details, refer to IPS Configuration Documentation.-o, --output-file string:Specifies the path to the dump file. When not specified, outputs to the standard output stream.--lang string:Sets the language for the output information. Default iszh-CN(Chinese).-f, --fields string:Specifies the fields to be extracted from the input file. Default is all fields. For a detailed explanation of the parameter, refer to IPS Configuration Documentation。-r, --rewrite-files string:Specifies the list of rewrite files to load. For a detailed explanation of the parameter, refer to IPS Configuration Documentation。
Examples
Dump IP Database Contents to Standard Output
# Export data from the GeoLite2-City.mmdb database file to the standard output streamips dump -i GeoLite2-City.mmdbDump IP Database Contents to a Text File
# Export data from the GeoLite2-City.mmdb database file to geoip.txtips dump -i GeoLite2-City.mmdb -o geoip.txtCustomize Export Fields
# Export only the country and city fields from the database fileips dump -i GeoLite2-City.mmdb -o geoip.txt --fields "country,city"Set Output Language and Rewrite Rules
# Set the output data language to English and apply rewrite rulesips dump -i GeoLite2-City.mmdb -o geoip.txt --lang en -r rewrite_rules.txtNotes
- Ensure that the
--input-filepoints to an existing and valid database file. - If
--input-formatis specified, make sure it matches the file format. - Using
--fieldscan reduce the amount of data output, exporting only the necessary fields. - The
--langoption can set the language of the output data as needed, typically used for multilingual databases. --rewrite-filescan be used to apply custom rewrite rules before exporting data, to correct errors in the database or for data customization.