织梦CMS - 轻松建站从此开始!

欧博ABG-会员注册-官网网址

Client last log

时间:2025-11-20 08:41来源: 作者:admin 点击: 14 次
lotsaram wrote: Thu Jan 19, 2012 8:17 am wilsonric wrote:The ability to record the last date a client logged in to TM1 would be very useful from a cli

lotsaram wrote: Thu Jan 19, 2012 8:17 am

wilsonric wrote:The ability to record the last date a client logged in to TM1 would be very useful from a client/licence management perspective.
If this information was recorded in the }ClientProperties cube it would be easy to see who is under utilising (or not using at all) their TM1 account. We could then utilise this licence for someone else, and provide the redundant or very casual user with an alternative data source - ie. a monthly report from Finance.

Anyone else interested?

Provided logging is on for }ClientProperties and ClientPropertiesSyncInterval parameter is used then this is a quite straightforward piece of coding to DIY. Bedrock.Server.UserLogins.Caller.pro
Bedrock.Server.UserLogins.pro
(Note I don't know if this has been officially added to bedrock, as I have adopted bedrock as a standard set of utilities I just adopted the naming and coding conventions ...)

All you need to do is run the caller process, it will automatically create the logging cube (need to run it 2x to initially set up the metadata). Then ongoing schedule the caller process in a chore to run daily and process the last 1 or 2 days only of tm1s logging output (assuming there is at least a daily SaveDataAll.)

If there is no change to naming conventions vs. the default param values then after the process has run you can get clients ordered by last login date with the following MDX.

Code:

{ORDER( {TM1SUBSETALL( [}Clients] )}, [SYS_UserProperties].([SYS_UserProperties_M].[Last Login Ordinal]), BDESC )}

Obviously the last login is only as current as 1/ the last time the process was run and 2/ the last time a save data was done. However for the purposes of compliance and tracking which users haven't accessed the system it is quite adequate.

Thank you for the code. You made my life easy.

I noticed that the log timestamp is GMT (as per IBM this cannot be changed within the file. Please correct me if I am wrong.

NOTE: Changing the log4j.appender.S1.TimeZone to LOCAL will not change what's in the actual log file on disk. This is always recorded in GMT. It does change the times to local time when you view the log file via Architect.

Source: https://www-01.ibm.com/support/docview. ... wg21459102 ).


I modified the code in Bedrock.Server.UserLogins.pro with following changes and I noticed that when I ASCIIOUTPUT the data, only the first line get the timezone conversion applied

Code:

sTimeStamp =SubSt(vTimeStamp, 1, 4) |'-'| SubSt(vTimeStamp, 5, 2) |'-'| SubSt(vTimeStamp, 7, 2) |' '| SubSt(vTimeStamp, 9, 2) |':'| SubSt(vTimeStamp, 11, 2) |':' | SubSt(vTimeStamp, 13, 2) ; nDateTime = ParseDate ( sTimeStamp, 'yyyy-MM-dd h:m:s' ) ; NewDateFormatter ( 'en_au', 'Australia/Sydney', 'serial', 'medium', 'datetime' ) ; sDateTimeAU = FormatDate ( nDateTime, 0 ) ; ASCIIOUTPUT ( 'date.txt',sTimeStamp, NumberToString ( nDateTime ) ,sDateTimeAU ) ;

Source: https://exploringtm1.com/date-time-functions-tm1-10-2/

ASCIIOUTPUT

Code:

"2019-12-04 03:37:10","21887.150810185","04/12/2019 2:37:10 PM" "2019-12-04 03:37:10","21886.692476852","2019-12-04 3:37:10"

Sourcefile: tm1s*.log file I am loading has 2 login records as below.

Code:

"","20191204033710","20191204033710","*","S","ACTIVE","","}ClientProperties","CAMID(""TMB:u:b98a4f20c97a33429de8405f91fc5948"")","STATUS","" "","20191204033710","20191204033710","*","S","","ACTIVE","}ClientProperties","CAMID(""TMB:u:b98a4f20c97a33429de8405f91fc5948"")","STATUS",""

The SYS_Userproperties cube has "2019-12-04 3:37:10" stamped against the user. Any idea what I am doing wrong.

(责任编辑:)
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:
发布者资料
查看详细资料 发送留言 加为好友 用户等级: 注册时间:2025-11-28 03:11 最后登录:2025-11-28 03:11
栏目列表
推荐内容