SirDuke wrote:Hello
I'm trying to process servers log(s) via TM1API. Everything seems to work almost fine. Just can not find a way how to filter log records on element names (like Architect allows to do when you select a particular cube).
I guess this is somehow driven by the last parameter (
sFlagFilter) of
TM1ServerLogOpen as per documentation excerpt bellow. Just scratching my head what the syntax should be...
Any help would be appreciated
Code: Select all
Declare Function TM1ServerLogOpen
Lib "tm1api.dll"
(ByVal hPool As Long,
ByVal hServer As Long,
ByVal rStartTime As
Long, ByVal sCubeFilter As long,
ByVal sUserFilter As Long, ByVal
sFlagFilter As Long) As Long #<=====!!!!
#sFlagFilter is a long. This TM1 value capsule contains a string used to filter records by flags
Sorry, I missed this one earlier this morning.
I don't think there is a way for you to do this
within the API function itself. As I mentioned in another reply the GUI contains more options than the API function does; note the absence of an EndTime argument in the function above.
I may be wrong and would be happily corrected if I am but I
believe that the sFlagFilter is intended only for use when you use the TM1ServerLogSetFlagString API function to add a flag yourself.
To filter by element names you would, I think, need to return the whole records and filter out the ones which don't relate to the element specified. I suspect that the GUI does this in the background. I can't really blame Iboglix for this one; filtering by cube and user within the API function would have been easy since those values are always in the same place on each row. Filtering by element would be a lot harder since every cube will have a different array of dimensions. It would therefore be easier (coding-wise) to apply the element filter(s) after the fact.
On the up side, it does give you the option of doing it better than the GUI does it since you could code it to filter out multiple elements per dimension, not just one.