Verified Commit 920bcb58 authored by CompileNix's avatar CompileNix

update MessageTemplateExpressions

parent 44043ff1
......@@ -5,7 +5,7 @@ class Config {
"test1.txt"
];
// nginx
this.defaultMessageTemplateFilter = /^\[((\d{1,2}\/\w{3}\/\d{4}):(\d{2}:\d{2}:\d{2}) ([+-]\d{4}))\] status:(\d{3}) request_time:(\d{1,}.\d{3}) upstream_response_time:((\d{1,}.\d{3})|-) bytes_sent:(\d{1,}) client_ip:(\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b|(:{0,2}[\da-f]{1,4}){1,8}) domain:([\w.-]*) request:"((\w{3,8}) (\/[\w-.,_~:<>\\/[\]%@!$'()*+;?=&#]*) HTTP\/(\d\.\d))" referer:"([\w-.,_~:<>\\/[\]%@!$'()*+;?=&#]*)" user_agent:"([\w-.,_~: \/[\]%@!$'()*+;?=&#]*)"$/;
this.defaultMessageTemplateFilter = /^\[((\d{1,2}\/\w{3}\/\d{4}):(\d{2}:\d{2}:\d{2}) ([+-]\d{4}))\] status:(\d{3}) request_time:(\d{1,}\.\d{3}) upstream_response_time:((\d{1,}\.\d{3})|-) bytes_sent:(\d{1,}) client_ip:(\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b|(:{0,2}[\da-f]{1,4}){1,8}) domain:([\w.-]*) port:(\d{1,5}) request:"((\w{3,8}) ([\w-.,_~:<>\\\/\[\]%@!$'()*+;?=&#]*) HTTP\/(\d\.\d))" referer:"([\w-.,_~:<>\\/[\]%@!$'()*+;?=&#]*)" user_agent:"([\w-.,_~: /[\]%@!$'()*+;?=&#]*)"$/;
this.defaultMatchingGroupName = {
All: 0,
DateTime: 1,
......@@ -18,12 +18,13 @@ class Config {
BytesSent: 9,
ClientIp: 10,
Domain: 12,
Request: 13,
Method: 14,
Path: 15,
ProtocolVersion: 16,
Referer: 17,
UserAgent: 18
Port: 13,
Request: 14,
Method: 15,
Path: 16,
ProtocolVersion: 17,
Referer: 18,
UserAgent: 19
};
// apache
// this.defaultMessageTemplateFilter = /^([\w.-]*):(\d{1,5}) (\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b|(:{0,2}[\da-f]{1,4}){1,8}) ([\w.-]*) ([\w.-]*) \[((\d{1,2}\/\w{3}\/\d{4}):(\d{2}:\d{2}:\d{2}) ([+-]\d{4}))\] "((\w{3,8}) (\/[\w-.,_~:<>\\/[\]%@!$'()*+;?=&#]*) HTTP\/(\d\.\d))" (\d{3}) (\d{1,}) "([\w-.,_~:<>\\/[\]%@!$'()*+;?=&#]*)" "([\w-.,_~: \/[\]%@!$'()*+;?=&#]*)"$/;
......
// Nginx
// log_format main '[$time_local] status:$status request_time:$request_time upstream_response_time:$upstream_response_time bytes_sent:$body_bytes_sent client_ip:$remote_addr domain:$host request:"$request" referer:"$http_referer" user_agent:"$http_user_agent"';
defaultMessageTemplateFilter = /^\[((\d{1,2}\/\w{3}\/\d{4}):(\d{2}:\d{2}:\d{2}) ([+-]\d{4}))\] status:(\d{3}) request_time:(\d{1,}.\d{3}) upstream_response_time:((\d{1,}.\d{3}|-)) bytes_sent:(\d{1,}) client_ip:(\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b|(:{0,2}[\da-f]{1,4}){1,8}) domain:([\w.-]*) request:"((\w{3,8}) (\/[\w-.,_~:<>\\/[\]%@!$'()*+;?=&#]*) HTTP\/(\d\.\d))" referer:"([\w-.,_~:<>\\/[\]%@!$'()*+;?=&#]*)" user_agent:"([\w-.,_~: \/[\]%@!$'()*+;?=&#]*)"$/;
// log_format main '[$time_local] status:$status request_time:$request_time upstream_response_time:$upstream_response_time bytes_sent:$body_bytes_sent client_ip:$remote_addr domain:$host port:$server_port request:"$request" referer:"$http_referer" user_agent:"$http_user_agent"';
defaultMessageTemplateFilter = /^\[((\d{1,2}\/\w{3}\/\d{4}):(\d{2}:\d{2}:\d{2}) ([+-]\d{4}))\] status:(\d{3}) request_time:(\d{1,}\.\d{3}) upstream_response_time:((\d{1,}\.\d{3})|-) bytes_sent:(\d{1,}) client_ip:(\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b|(:{0,2}[\da-f]{1,4}){1,8}) domain:([\w.-]*) port:(\d{1,5}) request:"((\w{3,8}) ([\w-.,_~:<>\\\/\[\]%@!$'()*+;?=&#]*) HTTP\/(\d\.\d))" referer:"([\w-.,_~:<>\\/[\]%@!$'()*+;?=&#]*)" user_agent:"([\w-.,_~: /[\]%@!$'()*+;?=&#]*)"$/;
defaultMatchingGroupName = {
All: 0,
DateTime: 1,
......@@ -13,12 +13,13 @@ defaultMatchingGroupName = {
BytesSent: 9,
ClientIp: 10,
Domain: 12,
Request: 13,
Method: 14,
Path: 15,
ProtocolVersion: 16,
Referer: 17,
UserAgent: 18
Port: 13,
Request: 14,
Method: 15,
Path: 16,
ProtocolVersion: 17,
Referer: 18,
UserAgent: 19
};
// Test strings
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment