Support Center
»
Knowledgebase
»
How to configure custom reports?
How to configure custom reports?
Solution
Custom reports are available in XpoLog for advanced reporting and computation on logs data.
Below are explanations how to create a custom report, more details can be found in XpoLog User Manual.
Custom Function Properties explanation:
1) After selecting custom type report, click 'Add new function' or 'edit' to create/edit a function
2) Name: Enter the function's name in the 'Name' text box.
3) In case you want to view the result as a graph over time check the 'Show result over time' checkbox. In case you just want to view a summary of the results, uncheck it.
4) In the 'Function' text area enter your function. For more details on the available functions and operators that can be used, please refer to latest user manual (Appendix A).
5) In the 'result type' list box select the type of your function's result. It can be list, map, time or other (string or number).
6) In case 'Show result over time' is checked, you can enter the graph axis (Y) name. Enter your axis value in 'Graph Axis Name' text box. Results with the same graph axis value will be displayed in the same graph. Otherwise different graphs will be shown for each result.
7) The 'Result Properties' text box allows you change default view properties:
'headerNames' - in case the result type is a list or map you can set new 'key/value' properties.
'sortby' - sort the result by your comparator .
'sortascend' - a Boolean value that determines whether sorting is done in ascending or descending order.
Example : headerNames=Column1;Column2;Column3,sortBy=Column1,sortAscend=true
Examples:
Add/Edit a report; select the custom section to manage custom functions of reports.
Example 1: Calculate Minimum / Maximum / Average
Assumption: there is a log column that is a numeric value
1. Select the column that you wish to run calculation on.
2. Select the predefined functions: Min / Max / Average (use the CTRL key for multiple selection) and click add.
3. Save and generate to review the result.
Example 2: user performance example – number of distinct users from each IP
Assumption: there is a log with ip column and user column
Function body:
# s2=the log second column which is the ip
ip=s2
# s3=the log third column which is the user
user=s3
newUser=false
key = NULL
# creating key for ip/user only if the user is not null
if (user != NULL && user != "") THEN (key = ip + "_" + user)
# checking if it’s a new or already counted user
if (user != NULL && user != "") THEN (newUser=mapget(keysMap,key,true))
# if it’s a new user, add it to the users map
if (newUser) THEN (keysMap = mapput(keysMap,key,false))
count=0
# if it’s a new distinct user update the IP map
if (newUser) THEN (count=mapget(aggMap,ip,0))
if (newUser) THEN (aggMap=mapput(aggMap,ip,(count + 1)))
# if there is more than one distinct user, update the result
if (count > 0) THEN (result = mapput(result, ("" + format(ip)),(count + 1)))
# return a map of IP with number of distinct users
result
Example 3: calculate the average time of a process
Assumption: there are log columns for the following:
- date
- context (identifier of the process type, in case there are more than one type)
- object name (the name of the object that it’s average time will be calculated)
- start/end (a column indicating if it’s a start or end operation)
# d1=the log first column which is the date
Date=d1
# s2=the log second column which is the context
Context=s2
# s3=the log third column which is the object name
Object=s3
# s4=the log forth column which is the start/end indicator
Status=s4
startObjName = NULL
endObjName = NULL
# if a start op of a process is detected store it
if (Context == "PROCESS_ACTIVITY" && Status != NULL && Status == “START”) THEN (startObjName = Object)
# if an end op of a process is detected store it
if (Context == "PROCESS_ACTIVITY" && Status != NULL && Status == “END”) THEN (endObjName = Object)
# if there was a start op save it’s time
if (startObjName!= NULL) THEN (mapTimeDiff = mapput(mapTimeDiff,startObjName,Date))
startTime = -1
# if there is an end time, extracting the start time of this process
if (endObjName != NULL) THEN (startTime = mapget(mapTimeDiff,endObjName,-1))
diff = -1
# if there is an end time and a start time – calculate difference and update average of this process
if (endObjName != NULL && startTime >= 0) THEN (diff = (Date - startTime))
if (endObjName != NULL && startTime >= 0) THEN (mapAvg = mapAggAvg(endObjName,(diff/60000)))
# return the processes average
mapAvg
Article Details
Article ID:
275
Created On:
15 Feb 2010 05:05 PM
This answer was helpful
This answer was not helpful
User Comments
Add a Comment
Sharing is good. So if you have a comment about this entry please feel free to share. The Comments might be reviewed by our Staff and might require approval before being posted. Questions posted will not be answered, please submit a ticket for support requests.
Image verification required
Please enter the characters that appear to the right in the space provided. This is just to verify that you are a human.
Fullname:
Email: (Optional)
Comments:
Back
Login
[Lost Password]
Email:
Password:
Remember Me:
Search
-- Entire Support Site --
Knowledgebase
Downloads
Article Options
Add Comment
Print Article
PDF Version
Email Article
Add to Favorites
Home
|
Submit a Ticket
|
Knowledgebase
|
News
|
Downloads
Language:
English (U.S.)