You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[2.1.2] created new `entity_relationship_diagram.png` to reflect database changes.
73
+
-[2.1.2] created new `entity_relationship_diagram.png` to reflect database changes.
74
+
-[2.1.3] modify `access_log` and `error_log` TABLES reordering COLUMNS to improve database design readability.
75
+
-[2.1.3] modify `normalize_useragent` to removed first parameter restriction. Any string 8 characters are more can be passed.
76
+
-[2.1.3] modify `apacheLogs2MySQL.py` add `completed` COLUMN to UPDATE statement to fix processing `process_access_import` and `process_error_import` with `ALL` parameter.
77
+
-[2.1.3] modify `call_processes.sql` adding more comments to better describe options and parameters and overall processing.
Copy file name to clipboardExpand all lines: .github/call_processes.sql
+18-4Lines changed: 18 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -5,8 +5,11 @@ process_access_parse - Parsing into proper columns. Apache Access formats use %r
5
5
process_access_import - normalization of parsed LOAD DATA table into 9 error tables & 3 comon log tables shared with error logs.
6
6
normalize_useragent - normalized Python parsed userAgent TABLE into 11 tables
7
7
Each Stored Procudure has 2 parameters.
8
-
- IN in_processName VARCHAR(100) - This indicates the LogFormat to process.
8
+
- IN in_processName VARCHAR(100) - This indicates the LogFormat to process.
9
+
NOTE: For normalize_useragent parameter can be any string >= 8 characters
9
10
- IN in_importLoadID VARCHAR(20) - This indicates to importloadid to process. Valid values 'ALL' or a value converted to INTEGER=importloadid
11
+
NOTE: if in_importLoadID='ALL' ONLY importloadID records with import_load TABLE "completed" COLUMN NOT NULL will be processed. This is to avoid
12
+
interfering with Python client modules uploading files at same time as server STORED PROCEDURES executing.
10
13
11
14
import_file TABLE - record of every access & error log file processed by Python processFiles function. Each LOAD DATA table has importfileid COLUMN.
12
15
import_load TABLE - record for every execution of Python process. Each record contains information on LogFormat log files processed.
@@ -19,8 +22,19 @@ by Python apacheLogs2MySQL.py processLogs function Or only LOAD DATA can be exec
19
22
20
23
LOAD DATA stage tables - load_access_combined, load_access_csv2mysql, load_access_vhost, load_error_default have a process_status COLUMN.
21
24
process_status=0 - LOAD DATA tables loaded with raw log data
22
-
process_status=1 - process_error_parse and process_access_parse executed on record
23
-
process_status=2 - process_error_import and process_access_import executed on record
25
+
process_status=1 - process_error_parse or process_access_parse executed on record
26
+
process_status=2 - process_error_import or process_access_import executed on record
27
+
28
+
If importing multiple domains check before executing process_error_import or process_access_import STORED PROCEDURES.
29
+
In order to filter and report data properly this SELECT statement should return NO RECORDS.
30
+
- SELECT * FROM apache_logs.import_file WHERE server_name IS NULL;
31
+
32
+
import_file TABLE UPDATES should execute after _parse STORED PROCEDURES if importing multiple formats with servername (%v). Parsing will fill-in columns.
33
+
if not using environment variables to SET ServerName and ServerPort in Python and no formats contain %v Format String UPDATES can be executed before Parsing.
34
+
import_file TABLE UPDATES must be executed before _import STORED PROCEDURES. Below are examples of possible UPDATE STATEMENTS based on imported log file name.
35
+
- UPDATE apache_logs.import_file SET server_name='farmfreshsoftware.com', server_port=443 WHERE server_name IS NULL AND name LIKE '%farmfreshsoftware%';
36
+
- UPDATE apache_logs.import_file SET server_name='farmwork.app', server_port=443 WHERE server_name IS NULL AND name LIKE '%farmwork%';
37
+
- UPDATE apache_logs.import_file SET server_name='ip255-255-255-255.us-east.com', server_port=443 WHERE server_name IS NULL AND name LIKE '%error%';
24
38
25
39
Commands below execute each Stored Procudure and process ALL importloadid based on process_status. Each VPS creates importloadid each time executed.
`added` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
2207
2207
PRIMARY KEY (`id`)
2208
2208
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Table keeps track of all application Windows, Linux and Mac clients loading logs to server application and long with logon and IP address information. It is important to know who is loading logs.';
0 commit comments