searching from a text file
-
hi.. i'd like to ask how can i read and search the contents of a log file from a remote computer? i've attached a sample log file and i want to search for "warning" or "critical error" based on the current date and time.. and i will display on a web page the next lines of it.. until it sees a blank space right next to the time stamp. any idea how to do that in vb.net? hope you can help me.. thanks.. what do i have to use? here's an example from the text file: ################################################################################################### 11/27/04 17:47:14:LOG FILE: D:\ORACLE\ADMIN\log\oramon_marsprod.log LEVEL: 1 PID: 1404 ################################################################################################### 11/27/04 17:47:14:************** ORAMON version: 1.0.6 (build: Jan, 28, 2003) ************* 11/27/04 17:49:15:ERROR#************* MONITOR: archive_dir_space ************** 11/27/04 17:49:15:ERROR#'(%PCT_FREE% >= 10 and %PCT_FREE% < 25)' (evaluated: '(15.8708639888514 >= 10 and 15.8708639888514 < 25)') is violated. 11/27/04 17:49:15:ERROR# DIR_NAME: Y:\oracle\MARS\archive 11/27/04 17:49:15:ERROR# TOTAL_BYTES: 65032785920 11/27/04 17:49:15:ERROR# FREE_BYTES: 12268359680 11/27/04 17:49:15:ERROR# PCT_FREE: 15.8708639888514 11/27/04 17:49:15:ERROR#**** Skipping mail for 'Y:\oracle\MARS\archive@1' 11/27/04 17:49:15:ERROR#***** The following mail will not be delivered 11/27/04 17:49:15:ERROR#Archive Directory: Y:\oracle\MARS\archive has low disk-space (TOTAL: 65032785920 bytes, FREE: 12268359680 bytes, 15.8708639888514 %free). Please make sure that ORABCK is running on the machine and other system files are not using an increased amount of space. 11/27/04 17:49:15:Evaluating pcond=> (15.8708639888514 < 2) 11/27/04 18:39:16:ERROR#************* MONITOR: ora_parameter ************** 11/27/04 18:39:16:ERROR#'('%PARAM_NAME%' ne 'open_cursors' and %PARAM_PCT_FREE% >= 6 and %PARAM_PCT_FREE% < 21)' (evaluated: '('db_files' ne 'open_cursors' and 19 >= 6 and 19 < 21)') is violated. 11/27/04 18:39:16:ERROR# PARAM_NAME: db_files 11/27/04 18:39:16:ERROR# ID: 11/27/04 18:39:16:ERROR# PARAM_CUR_VALUE: 205 11/27/04 18:39:16:ERROR# PARAM_MAX_VALUE: 256 11/27/04 18:39:16:ERROR# PARAM_PCT_FREE: 19 11/27/04 18:39:16:ERROR#**** Skipping mail for 'db_files@1' 11/27/04 18:39:16:ERROR#***** The following mail will not be delivered 11/27/04 18:39:16:ERROR#'db_files' init.ora parameter (current: 205, max: 256) has low resource free%: 19. This is a symptom of incorrect init.o
-
hi.. i'd like to ask how can i read and search the contents of a log file from a remote computer? i've attached a sample log file and i want to search for "warning" or "critical error" based on the current date and time.. and i will display on a web page the next lines of it.. until it sees a blank space right next to the time stamp. any idea how to do that in vb.net? hope you can help me.. thanks.. what do i have to use? here's an example from the text file: ################################################################################################### 11/27/04 17:47:14:LOG FILE: D:\ORACLE\ADMIN\log\oramon_marsprod.log LEVEL: 1 PID: 1404 ################################################################################################### 11/27/04 17:47:14:************** ORAMON version: 1.0.6 (build: Jan, 28, 2003) ************* 11/27/04 17:49:15:ERROR#************* MONITOR: archive_dir_space ************** 11/27/04 17:49:15:ERROR#'(%PCT_FREE% >= 10 and %PCT_FREE% < 25)' (evaluated: '(15.8708639888514 >= 10 and 15.8708639888514 < 25)') is violated. 11/27/04 17:49:15:ERROR# DIR_NAME: Y:\oracle\MARS\archive 11/27/04 17:49:15:ERROR# TOTAL_BYTES: 65032785920 11/27/04 17:49:15:ERROR# FREE_BYTES: 12268359680 11/27/04 17:49:15:ERROR# PCT_FREE: 15.8708639888514 11/27/04 17:49:15:ERROR#**** Skipping mail for 'Y:\oracle\MARS\archive@1' 11/27/04 17:49:15:ERROR#***** The following mail will not be delivered 11/27/04 17:49:15:ERROR#Archive Directory: Y:\oracle\MARS\archive has low disk-space (TOTAL: 65032785920 bytes, FREE: 12268359680 bytes, 15.8708639888514 %free). Please make sure that ORABCK is running on the machine and other system files are not using an increased amount of space. 11/27/04 17:49:15:Evaluating pcond=> (15.8708639888514 < 2) 11/27/04 18:39:16:ERROR#************* MONITOR: ora_parameter ************** 11/27/04 18:39:16:ERROR#'('%PARAM_NAME%' ne 'open_cursors' and %PARAM_PCT_FREE% >= 6 and %PARAM_PCT_FREE% < 21)' (evaluated: '('db_files' ne 'open_cursors' and 19 >= 6 and 19 < 21)') is violated. 11/27/04 18:39:16:ERROR# PARAM_NAME: db_files 11/27/04 18:39:16:ERROR# ID: 11/27/04 18:39:16:ERROR# PARAM_CUR_VALUE: 205 11/27/04 18:39:16:ERROR# PARAM_MAX_VALUE: 256 11/27/04 18:39:16:ERROR# PARAM_PCT_FREE: 19 11/27/04 18:39:16:ERROR#**** Skipping mail for 'db_files@1' 11/27/04 18:39:16:ERROR#***** The following mail will not be delivered 11/27/04 18:39:16:ERROR#'db_files' init.ora parameter (current: 205, max: 256) has low resource free%: 19. This is a symptom of incorrect init.o
I'd imagine that you'd use regular expressions to capture the text you need. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
-
I'd imagine that you'd use regular expressions to capture the text you need. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
hi..what are regular expressions? i'd like to extract the lines between the warning or critical error and the line before the blank space after the time stamp
-
hi..what are regular expressions? i'd like to extract the lines between the warning or critical error and the line before the blank space after the time stamp
Google is your friend. MSDN also has a lot of info on regular expressions. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer