1
我有下面的日志文件,正在使用NodeJS编写日志监视。我的解析器是基于正则表达式的,所以如果我在日志文件中收到可以转换成多条日志消息的新行,我应该能够提取它们。对于我需要一个rtegex提取variouys日志消息提取日志RegEX中2个时间戳模式之间的消息
Fri Jan 24 05:28:57 2014
MEMORY_TARGET defaulting to 1128267776.
* instance_number obtained from CSS = 1, checking for the existence of node 0...
* node 0 does not exist. instance_number = 1
Starting ORACLE instance (normal)
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Initial number of CPU is 48
Number of processor cores in the system is 24
Number of processor sockets in the system is 12
Private Interface 'nxge20:1' configured from GPnP for use as a private interconnect.
abc
[name='nxge20:1', type=1, ip=169.254.121.29, mac=00-21-28-0e-8c-ae-00-00-00-00-00-00-00-00-00-00-00-2f-ff-ff, net=169.254.0.0/16, mask=255.255.0.0, use=haip:cluster_interconnect/62]
Public Interface 'nxge0' configured from GPnP for use as a public interface.
[name='nxge0', type=1, ip=172.20.70.18, mac=00-21-28-0e-94-ce-00-00-00-00-00-00-00-00-00-00-00-2f-ff-ff, net=172.20.70.0/24, mask=255.255.255.0, use=public/1]
Public Interface 'nxge21' configured from GPnP for use as a public interface.
[name='nxge21', type=1, ip=100.100.100.1, mac=00-21-28-0e-8c-af-00-00-00-00-00-00-00-00-00-00-00-2f-ff-ff, net=100.100.100.0/23, mask=255.255.254.0, use=public/1]
Shared memory segment for instance monitoring created
CELL communication is configured to use 0 interface(s):
CELL IP affinity details:
NUMA status: NUMA system w/ 3 process groups
cellaffinity.ora status: cannot find affinity map at '/etc/oracle/cell/network-config/cellaffinity.ora' (see trace file for details)
CELL communication will use 1 IP group(s):
Grp 0:
Picked latch-free SCN scheme 3
Using LOG_ARCHIVE_DEST_1 parameter default value as /dbtop/grid/dbs/arch
Autotune of undo retention is turned on.
LICENSE_MAX_USERS = 0
SYS auditing is disabled
NOTE: Volume support enabled
NUMA system with 3 nodes detected
Starting up:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options.
ORACLE_HOME = /dbtop/grid
System name: SunOS
Node name: sec33-e
Release: 5.10
Version: Generic_142909-17
Machine: sun4u
Using parameter settings in server-side spfile /dbtop/asm/dbs/spfile+ASM.ora
System parameters with non-default values:
large_pool_size = 12M
instance_type = "asm"
remote_login_passwordfile= "EXCLUSIVE"
asm_diskstring = "/dev/rdsk/*"
asm_diskgroups = "WFREC"
asm_diskgroups = "WFDATA"
asm_power_limit = 7
diagnostic_dest = "/dbtop/app/oracle"
Cluster communication is configured to use the following interface(s) for this instance
169.254.121.29
cluster interconnect IPC version:Oracle UDP/IP (generic)
IPC Vendor 1 proto 2
Fri Jan 24 05:29:03 2014
PMON started with pid=2, OS id=17520
Fri Jan 24 05:29:04 2014
PSP0 started with pid=3, OS id=17521
Fri Jan 24 05:29:05 2014
VKTM started with pid=4, OS id=17522 at elevated priority
VKTM running at (10)millisec precision with DBRM quantum (100)ms
我已经尝试使用下面的正则表达式来匹配组中的DATATIME和地点:
(\w{1,3} \w{1,3} \d{1,2} \d{1,2}:\d{1,2}:\d{1,2} \d{4})
其匹配的时间戳,如何我可以GRAP日志消息的其余部分在第二组
见['/ ^([AZ] {1,3} [AZ] {1,3} \ d {1,2} \ d {1,2}:\ d {1,2}:\ d {1,2} \ d {4})\ r?\ n(。*(?:\ r?\ n(?![az] {1,3} [az] {1,3} \ d {1,2} \ d {1,2}:\ d {1,2}:\ d {1,2} \ d {4})*)*)/ gmi'](https://regex101.com/r/1hRWqW/1)。 –
非常感谢它的工作:) – user7442303