Anonymous_User Absent Member.
Absent Member.
319 views

Custom.js Problems


I am trying to parse some additional data from the IDM Collector from
either the TargetTrustDomain and TargetUserDomain or the Message itself.
When I try to put e.TargetTrustDomain or e.TargetUserDomain or
e.Message into a variable I do not get any data. I am able to put
e.ExtendedInformation into a variable but it does not contain the data I
require. What variable do I need to query to parse the information
contained in those fields?


--
marcrusa
------------------------------------------------------------------------
marcrusa's Profile: http://forums.novell.com/member.php?userid=12128
View this thread: http://forums.novell.com/showthread.php?t=451280

0 Likes
7 Replies
Anonymous_User Absent Member.
Absent Member.

Re: Custom.js Problems


marcrusa;2170228 Wrote:
> I am trying to parse some additional data from the IDM Collector from
> either the TargetTrustDomain and TargetUserDomain or the Message itself.
> When I try to put e.TargetTrustDomain or e.TargetUserDomain or
> e.Message into a variable I do not get any data. I am able to put
> e.ExtendedInformation into a variable but it does not contain the data I
> require. What variable do I need to query to parse the information
> contained in those fields?


I'm assuming you're doing this in the customParse() method, after all
the other parsing has completed. Notice the function prototype - you
are actually still within the record object itself, and therefore at the
point in time you are trying to parse, all the source information is
still contained there. Since you are in record, you can just refer to
it as 'this'.

As far as looking for the data, I would recommend putting a breakpoint
in your customParse() function, and use the debugger to look at the
various properties of the record object for the source information you
seek. From there you can parse it into your own values and apply to
the event object.


--
langleyb
------------------------------------------------------------------------
langleyb's Profile: http://forums.novell.com/member.php?userid=109408
View this thread: http://forums.novell.com/showthread.php?t=451280

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Custom.js Problems


Yes, I am bring to accomplish this in the customParse() method. I just
tried this.TargetTrustDomain and this.Message and did not get any data
back. How do I put a break point into the customParse() method so that
I can properly troubleshot it in the debugger?


--
marcrusa
------------------------------------------------------------------------
marcrusa's Profile: http://forums.novell.com/member.php?userid=12128
View this thread: http://forums.novell.com/showthread.php?t=451280

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Custom.js Problems

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

There is no way to do good debugging in the custom.js unfortunately (at
least, not that I've found). I entered Bug# 742916 for this recently.
You could modify the base collector, or create your own for the same
parsing. I think in the end you should probably be avoiding the final
versions of those fields in the regular processing. Unless you know
e.TargetTrustDomain (or any other instance variable) was already set by
something then you're probably better off parsing directly from the
original message data or something that came from it which is already
available.

Good luck.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJPH1bzAAoJEF+XTK08PnB5kKUP/3b0cHYbviuNq5Zckb7Bnmm8
8ttm5KTljcoSHfGEJOAqqO8ZJYvbv2wxCJUS2PYGm7jKGw3ZG9LpuyYViBPonITu
V2o1NABrOAQzxieANQ4jZC4jOq7e5aZvoM/Unp54xL5IGD4tJe/m+awHLzxg1BKq
S6uT5V61amjtg8ww+quvd8VFJy/kuCv1RdAw0wpKNEq6rnHjduZ2tI3duBBtkOfL
TiWBRwaCyDEYQojhwPscCjx14N9XyYNOEWmshPxa1uZIwE1CcGJcfYc3EhWqaVGd
0SZP599r2UL9hYNMWH59J3tzQ9kF9JpTmhodqC9y+Eujrv60Xg8MlUNilqKb11/W
R/g8JMXuwWwNcEf9SSaKo/wiDToFDE6xAl5EoHrroyUqQ1Mw0i8b148Jm1zFmvmw
OsLhROauChAfw4U7pK8cxynSH5pIRF7p/mOYdZnOmRjNSeDWSsHuAKxLNKtn/WWM
SAgWiCKhBxpMkJ83oE+lDQcu48t9ijL2gqVJd/fFc0GGzOtMuJcGn8afHSqZZhTu
VhqOP2TFpOLO2gGniC+u7I6MzgjJeg5D+SvITIZPwjZHXQ3TSSw56VAjddWIrClI
wKeo1zsUZ3pp9PVwanqX4DC9nM1zIVBSKi1x6iVe+dfBjEzCnhORobTpSmS38DzX
cg3IWQYA3rkt+FTQsk4a
=kXFe
-----END PGP SIGNATURE-----
0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Custom.js Problems


What variable do I use to return the original message?


--
marcrusa
------------------------------------------------------------------------
marcrusa's Profile: http://forums.novell.com/member.php?userid=12128
View this thread: http://forums.novell.com/showthread.php?t=451280

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Custom.js Problems

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I would guess rec.s_RXBufferString but that's not an educated guess...
just a wild guess. I think the early processing takes all of the fields
from the Audit framework (named things like 'I' ,'2', 'D', etc.) and
puts them into instance variable that may also work somehow, but I'm not
positive of their access from within an event. I will try to look into
this when I have a couple free moments.

Good luck.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJPIDqnAAoJEF+XTK08PnB5b6MQALJSIkM5LyrLp4HIg/gvN8ep
0IK0JfxnO5h/perm82RK0TEklSYVE8gp3epoTZNnABLJdY0sCVXuAevzGr/e/RgQ
wirJYISU0rx9L4bmNsonQHoJs6XRqr2wzI3dZLc/4+tPW3GtE61VspwLP6PG2taC
tOfhVnF4G6E0I5EVuZpryQom2BeY27wSSpUBfkCYYGmZI/tDsJ7ZyQ/pGGLsbKSH
NqC5jvd+uwrS7weHERIMSe3aoBPs8xvkrkFKMVsPxarHS21GPqP6zYP7zKx+gzJE
UDFDnIslM0gq7LVqbS62f0rqgT50lJttkaSgSquU33VZgbR/K4L7O/NPBkoHmJif
sbAQwJA2YFg2BlFQF7QNC0xMci6XlJ8okHoh9u1FsjRg2DqnT6l9w8jBqlG2fHvk
L4uJ7SX1vAXVI5vGz9HqWFEctBDQr/V6jcJNitqpMR9vr+fZHaILrWmrq6U8/Uo6
PZNBsl2xPM/6n/Cotmprw4z0wCZt8UNYRJwCCXOsKemA5OIVe0Mb7FA1LMs0dHt7
Pe3vQiPeEO0vqcWD4ncmhsR03TmvQIQjBGpWDgIz/xPnmePmXWonQ8DC+CSmLhep
4TcB/bUFRZeu5KRkFBwdxulEztfM7Q3yB95FO3aFFOckPnKBGtonGOytxzZ/2zk2
IDK4rOyTldEcaSlB6hbm
=X0zg
-----END PGP SIGNATURE-----
0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Custom.js Problems


I worked with Mike from Novell Consulting and the trick was to unzip the
collector and look in the Rec2Evt.map file. It shows the correct
variable names to use for that collector. I wound up having to use
this.targtrust.domain and this.targuser.domain and running the regex
against them to get the data into CustomerVar141 and CustomerVar142.

Thank you.


ab;2170511 Wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I would guess rec.s_RXBufferString but that's not an educated guess...
> just a wild guess. I think the early processing takes all of the
> fields
> from the Audit framework (named things like 'I' ,'2', 'D', etc.) and
> puts them into instance variable that may also work somehow, but I'm
> not
> positive of their access from within an event. I will try to look
> into
> this when I have a couple free moments.
>
> Good luck.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.15 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - 'Enigmail: A simple interface for
> OpenPGP email security' (http://enigmail.mozdev.org/)
>
> iQIcBAEBAgAGBQJPIDqnAAoJEF+XTK08PnB5b6MQALJSIkM5LyrLp4HIg/gvN8ep
> 0IK0JfxnO5h/perm82RK0TEklSYVE8gp3epoTZNnABLJdY0sCVXuAevzGr/e/RgQ
> wirJYISU0rx9L4bmNsonQHoJs6XRqr2wzI3dZLc/4+tPW3GtE61VspwLP6PG2taC
> tOfhVnF4G6E0I5EVuZpryQom2BeY27wSSpUBfkCYYGmZI/tDsJ7ZyQ/pGGLsbKSH
> NqC5jvd+uwrS7weHERIMSe3aoBPs8xvkrkFKMVsPxarHS21GPqP6zYP7zKx+gzJE
> UDFDnIslM0gq7LVqbS62f0rqgT50lJttkaSgSquU33VZgbR/K4L7O/NPBkoHmJif
> sbAQwJA2YFg2BlFQF7QNC0xMci6XlJ8okHoh9u1FsjRg2DqnT6l9w8jBqlG2fHvk
> L4uJ7SX1vAXVI5vGz9HqWFEctBDQr/V6jcJNitqpMR9vr+fZHaILrWmrq6U8/Uo6
> PZNBsl2xPM/6n/Cotmprw4z0wCZt8UNYRJwCCXOsKemA5OIVe0Mb7FA1LMs0dHt7
> Pe3vQiPeEO0vqcWD4ncmhsR03TmvQIQjBGpWDgIz/xPnmePmXWonQ8DC+CSmLhep
> 4TcB/bUFRZeu5KRkFBwdxulEztfM7Q3yB95FO3aFFOckPnKBGtonGOytxzZ/2zk2
> IDK4rOyTldEcaSlB6hbm
> =X0zg
> -----END PGP SIGNATURE-----



--
marcrusa
------------------------------------------------------------------------
marcrusa's Profile: http://forums.novell.com/member.php?userid=12128
View this thread: http://forums.novell.com/showthread.php?t=451280

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Custom.js Problems


Hi marcrusa,

There are a couple things that I'll try to clarify to help you out
here.

1) The Collector operates by walking through an execution loop, as
described via the graphic here:
'Collectors' (http://www.novell.com/developer/collectors.html)
As you can see, there's a call out to customParse() (the yellow state
labeled "parse") after the regular Collector has completed its parsing.
It's important to note, however, that this ONLY happens if you set the
Execution Mode parameter of the Collector to 'Custom' (I think you
already did this).

2) Your custom code is loaded dynamically from the custom.js file; as a
result, it's actually not possible to debug it directly (this is a
limitation of the JS debugger, something that we'd like to fix as Aaron
mentioned). On the other hand, what you're really concerned about is the
state of the Collector immediately BEFORE you drop into your
customParse() method. To that end, the easiest thing to do is to start
your debugger, scroll all the way to the bottom, and put a break point
on the line in main.js that calls customParse(). Then when you run the
code, it should stop just before it calls your custom method. When this
happens, you can look at the state of the 'rec' global variable in the
variable browser to see what fields are available to you. When you drop
into customParse(), 'rec' will become 'this', but otherwise nothing will
change.

3) Your customParse() method should then perform whatever additional
data processing you need to perform on that data. You should store your
results back into some attribute on 'rec' - it doesn't really matter
what you call it, as long as you don't overwrite an existing attribute -
otherwise your results will disappear when customParse() exits.

4) The way you actually get data from the 'rec' object into the output
event 'e' is via the Rec2Evt.map file. But rather than modifying that
file directly and attaching it to the Collector, I would recommend
creating your own map in the same format (perhaps customR2E.map), adding
it to the Collector, and then loading it in customInit() using a method
like
this.MAPS.Rec2Evt.extend(this.CONFIG.collDir + "/Rec2Evt.map");
This code will extend the existing map with your custom mappings, but
what you gain by doing it this way is that Collector upgrades won't
break your changes.
One example might be to add something like this to customR2E.map:

CustomerVar123,targuser.domain

This would copy rec.targuser.domain into CustomerVar123.


--
DCorlette
------------------------------------------------------------------------
DCorlette's Profile: http://forums.novell.com/member.php?userid=4437
View this thread: http://forums.novell.com/showthread.php?t=451280

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.