Anonymous_User Absent Member.
Absent Member.
309 views

custom file collector


Hi i have to build a collector for this log:

# 00857256920, servidores, internos, usuarios, FNDE
dn: cn=00857256920,ou=servidores,ou=internos,ou=usuarios,o=FNDE
fndeCPF: 00857256920
fullName: ANDRESSA ZUCCHI

i need do capture that two lines and put in report.

my expression is: ([A-Z]{3,}):\s(\S+)\s

okay, i create a new collector and customize the release , but dont
work. can i send to mee one example of realese.js for that case.

i work in that line:


Code:
--------------------
Collector.prototype.initialize = function(){
this.MAPS.syslogSev = new KeyMap(this.CONFIG.collDir + "severity.map");
this.MAPS.statusCodeMap = new KeyMap(this.CONFIG.collDir + "statuscodes.map");
return true;
}


Collector.prototype.cleanup = function(){
return true;
};

Connector.prototype.sendQuery = function(){
return true;
};

Record.prototype.preParse = function(e){
if (this.CONNECTION_ERROR != null) {
return false;
}
return true;
}

Record.prototype.parse = function(e){
if (/([A-Z]{3,}):\s(\S+)\s/.test(this.s_RXBufferString))
{
this.id=RegExp.$1;
this.msg = instance.MAPS.statusCodeMap.lookup(this.id);
}
return true;
}


Record.prototype.normalize = function(e){
return true;
};


Record.prototype.postParse = function(e){
return true;
};


Record.prototype.reply = function(e){
return true;
};
--------------------


--
diogobsb
------------------------------------------------------------------------
diogobsb's Profile: https://forums.netiq.com/member.php?userid=7491
View this thread: https://forums.netiq.com/showthread.php?t=51176

0 Likes
3 Replies
Anonymous_User Absent Member.
Absent Member.

Re: custom file collector

First, is there a reason you are not using something like the identities
collector? I believe this is already made to handle LDIF files, and while
it is listed to work with microsoft active directory (MAD) I do not know
that this is really a requirement. Even if it does not work out
perfectly, it should have some useful code for you to parse this input
assuming you cannot do so with a properly LDAP class.

Also, what does "but dont work" mean exactly in your case? How does it
not work?

Is there a reason your regular expression is requiring at least three
characters before the colon? I suspect that is not what you want since
not even 'dn' has three characters. Also, I do not see anything there
making your regular expression's character class case-insensitive and
since you're using upper case I would expect that to fail for all of your
lines since all of those attributes are appropriately lower-case, at least
at the beginning.

--
Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below...
0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: custom file collector


in first thanks for your help.
let me explain, i need to create a parse with this expression to capture
3 values into 3 variables:
fndeCpf into var CPF
fndeFullName into var User
and a complete line begins with word "filter: ", because that i have
that expression.

I have download the microsoft-ad-identity to edit.

but i want to see any release.js to know how can i put my custom
expression and atribute parts of that for the var and show this in my
report.


--
diogobsb
------------------------------------------------------------------------
diogobsb's Profile: https://forums.netiq.com/member.php?userid=7491
View this thread: https://forums.netiq.com/showthread.php?t=51176

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: custom file collector


if you send to me my email i sent to you my log and my release.js ....
thanks again.


--
diogobsb
------------------------------------------------------------------------
diogobsb's Profile: https://forums.netiq.com/member.php?userid=7491
View this thread: https://forums.netiq.com/showthread.php?t=51176

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.