how to trigger a last log of application through mail

Post Reply
vinod
Posts: 4
Joined: Tue Mar 21, 2017 10:45 am
OLAP Product: IBM TM1
Version: 10.2.2
Excel Version: Excel2013

how to trigger a last log of application through mail

Post by vinod »

Hi,

I am new to tm1,I want to trigger last log of application(last row of tm1s.log) through mail,could you please help me on this.Thanks in advance.

Thanks&Regards,
Vinod Reddy.
Bakkone
Posts: 119
Joined: Mon Oct 27, 2014 10:50 am
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2013

Re: how to trigger a last log of application through mail

Post by Bakkone »

What exactly do you want to do?

The last row changes constantly. Do you want to e-mail every new last row?
vinod
Posts: 4
Joined: Tue Mar 21, 2017 10:45 am
OLAP Product: IBM TM1
Version: 10.2.2
Excel Version: Excel2013

Re: how to trigger a last log of application through mail

Post by vinod »

thanks for your reply,i want to trigger the details of 'last person who used application in a day' as a mail,could anyone please help me its argent.
declanr
MVP
Posts: 1815
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: how to trigger a last log of application through mail

Post by declanr »

Hi,

By application do you mean just a tm1 service or a specific application within contributor or a specific cube etc? It may seem pedantic to ask but "application" is a word that is used in the IBM and TM1 world to mean a lot of different things.

Generally though you would need a chore schedule for whatever time you deem to be the "end of the day"; it would need to run a savedataall so that your tm1s.log file gets a timestamped off version at that point in time.
Then use a TI process to read the most recent timestamped tm1s.log file and skip to the last record.
You would need to delimit it by if i recall correctly 3 spaces or 3 tabs (haven't taken one in for a while so can't remember but its easy to work out by looking at it.)

Then via TI you can send an email using multiple methods; a lot of different options on here have posts about them - you need to think about what the company you work with allow. I like executable applications like blat or sendemail.exe; some like VBS and powershell is also a good one... whichevwr you go for you will probably need to get exchange server details and so such from IT or if you are lucky the TM1 service will be running under a user that has an email you can easily authenticate to.

The first question of what you consider an application may change some of the follow up comments though.
From a pure point of interest on my part I would like to hear what the purpose of your requirement is and where the benefit of knowing who the last user to change something is.
Declan Rodger
vinod
Posts: 4
Joined: Tue Mar 21, 2017 10:45 am
OLAP Product: IBM TM1
Version: 10.2.2
Excel Version: Excel2013

Re: how to trigger a last log of application through mail

Post by vinod »

thanks declanr for your reply,actually i want to trigger the details of last user who changed the cube values,that details are stored in tm1s.log right,but in my application 3 tm1s.log files are creating with different time stamp in a day so i want to pick the latest time stamp file and in that i have to find last user and i want to trigger that your name,is there any function is available for taking latest time stamp file in tm1?
David Usherwood
Site Admin
Posts: 1453
Joined: Wed May 28, 2008 9:09 am

Re: how to trigger a last log of application through mail

Post by David Usherwood »

@vinod, I think you need to mug up some more on how logfiles work. The latest logfile is always tm1s.log - but it is locked by the server. To make it available for processing, execute a SaveDataAll, which closes tm1s.log, renames it with a timestamp, and opens a new tm1s.log. You can then identify the file using WildcardFileSearch and process it with TI as a data source - or use another tool to work with it (perl, python, java...).
User avatar
gtonkin
MVP
Posts: 1198
Joined: Thu May 06, 2010 3:03 pm
OLAP Product: TM1
Version: Latest and greatest
Excel Version: Office 365 64-bit
Location: JHB, South Africa
Contact:

Re: how to trigger a last log of application through mail

Post by gtonkin »

You could also use something like the unix TAIL command to give you the last x number of lines in the latest log file once you have run the SaveDataAll, pipe this to another file then email with a command line emailer - search this forum for tips on emailing too.

FYI for those who are not aware of TAIL, very useful for polling files too e.g. Tail -f on tm1server.log for instance will show you changes as they are written. Useful when starting up to see what is happening.
Post Reply