Business
CourseCatalog
DairyBase
eCatalog
FarmBase
Form Server
Furlough Request
IntraOffice
PDF Merge
SalvageMan
Recycler Inventory Record
Recycler Tow Log
SkillTrak
TaskTrak
TimeTrak
Vehicle Dismantle Request
Vehicle Title and Registration
Web@assessor
Service Apps
MailIn
MailOut
Medical
BloodWorks
Patient Outcomes
Med Credentials
Miscellaneous
MovieListings
SyncMovie
DailyScores
DailyQuotes
Utilities
dbGeocode
LdapClimb
LogImport
LogFilter
RunUrl
Sync2Ldap
SyncTable
WebStats
Project: LogImport
Client: MicroWeb
Keywords: Java File Import
Description: LogImport is a java program used to import log files into a database.
Platform: Java 2 Runtime Environment (Windows, Mac, Unix, Linux)

Project Summary
LogImport is a java command line program used to import log files into a database. It was mainly developed to import webserver log files into a database used for site statistics and reporting. A simple configuration file is used to determine which fields are imported into the database.

Requirements

  • Java 2 runtime environment (J2SE)
  • JDBC driver for database that will be updated

Tested Systems


Note: SyncTable does NOT work with the Sun Microsystems jdbc:odbc bridge.

Command Line
C:\MicroWeb\SyncTable>java -jar LogImport.jar <config_file> [<file=filename>]
<config_file> The name of the configuration file

Tip: On windows machines use the forward slash character '/' to deliminate folder names if your configuration file is not in the same folder as the program.
file="filename" This option is used to specify the log file to import on the command line overriding the value in the configuration file.

Configuration File Parameters
app.debug [yes|no] : turns debug messages on/off
db.driver The JDBC driver name for the log database.
Example (MySQL database):
db.driver=com.mysql.jdbc.Driver
db.url The JDBC driver connection paramters used to access the log database.
Example (MySQL database):
db.url=jdbc:mysql://127.0.0.1/mydatabase?user=myuser&password=mypassword
db.dateformat The date format used by the log database for date fields
Example (MySQL database):
db.dateformat=yyyy-MM-dd
db.timeformat The time format used by the log database for time fields
Example (MySQL database):
db.timeformat=hh:mm:ss
db.datetimeformat The date/time format used by the log database for date/time fields
Example (MySQL database):
db.datetimeformat=yyyy/MM/dd hh:mm:ss a
import.srcfile The name of the log file to import into the database. Alternatively, this can be overriden by the value specified on the command line.
Example (MySQL database):
import.logfile=ex20050201.log
import.delimiter The delimiter character used in the log file to seperate field values. User \\s to specify a space character or \\t to specify a tab.
Example (comma delimiter):
import.delimiter=,
import.table The name of the table to import the log records.
Example: import.table=Weblogs
import.keyfield The name of the import table primary key field.
Example: import.keyfield=log_id
import.dateformat The date format used in the import log file
Example: import.dateformat=yyyy-MM-dd
import.updateField [optional] The name of the import table field that will be updated with the log file name.
Example: import.updateField=log_filename
import.srcfolder [optional] The path to the folder containing the import log file
field.N.id LogImport can import up to 100 table fields. N is a number from 0 to 99 that indicates the log file field position and the corresponding database field name. Each field in the log file must be represented. To prevent importing a field into the database that is in the log file, leave the entry blank.

Example: (import all fields except field at position 4)

field.0.id=RequestDate
field.1.id=RequestTime
field.2.id=ClientIP
field.3.id=UserName
field.4.id=
field.5.id=ServerIP
field.6.id=HttpMethod
field.7.id=UrlTarget
field.8.id=UrlParam
field.9.id=HttpStatus
field.10.id=BytesSent
field.11.id=BytesReceived
field.12.id=ProcTime
field.13.id=UserAgent
field.14.id=UrlReferer
:
:
field.99.id=

 

Copyright (c) 2019 by MicroWeb. All Rights Reserved
www.microwww.com