Dear All,

I have a collector custom demand, I want to add some codes(else if
( ) {}) into Record.prototype.parse, I know the implement way to add
some codes into customParse() and Collector.prototype.customInit in
custom.js, But I don`t know the detail steps for adding codes and which
codes need to be added into the file, for example: I want to add some
codes into Record.prototype.parse section in release.js, But i don`t can
add these codes into release.js, but add some codes into custom.js,
which codes need to be added into custom.js? detail codes are
following:

before modified:
================================================== ===============================
Record.prototype.parse = function(e){
if (this.s_RXBufferString == "" || this.s_RXBufferString.length == 0
) {
return false;
}

this.msg = this.msg.replace(/ /g,'');
this.msg = this.msg.replace(/\r\n/g,'');
this.msg = this.msg.replace(/\n/g,'');
this.msg = this.msg.replace(/\t/g,'');
if
(/^Index.*New-TransportRule.*From=\{(\S+)@(\S+)\}.*CopyTo=\{(\S+ )@(\S+)\}}.*Category.*$/.test(this.msg))
{
this.evt = "New-TransportRule";
this.sun = RegExp.$1;
this.dun = RegExp.$3;
this.iemail = RegExp.$1 + "@" + RegExp.$2;
this.temail = RegExp.$3 + "@" + RegExp.$4;
return true;
} else if
(/^RunspaceId.*LogonType.*Delegate.*ClientIPAddress. *:\s(\d+\.\d+\.\d+\.\d+)ClientMachineName.*Mailbox OwnerUPN.*:\s(\S+).*MailboxOwnerSid.*LogonUserDisp layName.*:\s(\S+).*LogonUserSid.*MailboxResolvedOw nerName.*:\s(\S+).*LastAccessed.*$/.test(this.msg))
{
this.evt = "Delegate";
this.sip = RegExp.$1;
this.temail = RegExp.$2;
this.sun = RegExp.$3;
this.dun = RegExp.$4;
return true;
}
else {
return false;
}

================================================== ===================================


after modified:
================================================== ===================================
Record.prototype.parse = function(e){
if (this.s_RXBufferString == "" || this.s_RXBufferString.length == 0
) {
return false;
}

this.msg = this.msg.replace(/ /g,'');
this.msg = this.msg.replace(/\r\n/g,'');
this.msg = this.msg.replace(/\n/g,'');
this.msg = this.msg.replace(/\t/g,'');
if
(/^Index.*New-TransportRule.*From=\{(\S+)@(\S+)\}.*CopyTo=\{(\S+ )@(\S+)\}}.*Category.*$/.test(this.msg))
{
this.evt = "New-TransportRule";
this.sun = RegExp.$1;
this.dun = RegExp.$3;
this.iemail = RegExp.$1 + "@" + RegExp.$2;
this.temail = RegExp.$3 + "@" + RegExp.$4;
return true;
} else if (/^Index.*\{Set-TransportRule.*Name=(.*),
Comments.*BlindCopyTo=\{(.*)\}\}.*\\\/(.*),.*S\-.*UserName.*$/.test(this.msg))
{
this.evt = "Set-TransportRule";
this.cv32 = RegExp.$1;
this.cv33 = RegExp.$2;
this.sun = RegExp.$3;
return true;
} else if
(/^RunspaceId.*LogonType.*Delegate.*ClientIPAddress. *:\s(\d+\.\d+\.\d+\.\d+)ClientMachineName.*Mailbox OwnerUPN.*:\s(\S+).*MailboxOwnerSid.*LogonUserDisp layName.*:\s(\S+).*LogonUserSid.*MailboxResolvedOw nerName.*:\s(\S+).*LastAccessed.*$/.test(this.msg))
{
this.evt = "Delegate";
this.sip = RegExp.$1;
this.temail = RegExp.$2;
this.sun = RegExp.$3;
this.dun = RegExp.$4;
return true;
}
else {
return false;
}
================================================== =================================================
which codes need to be added into custom.js?

Collector.prototype.customInit = function() {


return true;
}


Record.prototype.customParse = function(e) {



return true;
}

Tks!
BR


--
steve_zeng
------------------------------------------------------------------------
steve_zeng's Profile: https://forums.netiq.com/member.php?userid=3875
View this thread: https://forums.netiq.com/showthread.php?t=48078