Clarity

  • 1.  CA Clarity Tuesday Tip: Enhanced App-Access Logs in 12.1.0

    Posted Jun 22, 2011 09:48 AM
    CA Clarity Tuesday Tip by Shawn Moore, Sr. Principal Support Engineer for 6/22/2011

    As of 12.1.0 on Apache Tomcat environments, we now use an "enhanced" app-access log format. This format provides additional fields and formats the data in a pipe-delimited manner. This makes importing these logs into a spreadsheet or database easy.

    The new format is as follows:

    IP address of requester|
    DateTime of the completed request|
    URL request|
    HTTP Status Code|
    Bytes sent back to the client (excluding the header)|
    Elapsed time of the request (in ms, can be subtracted from the DateTime to get the request startTime)|
    Clarity sessionId cookie (a distinct way to group requests, can be tied back to the sessions tables in Clarity to find the user)

    Here's an example.

    130.200.243.199|[18/Apr/2011:16:45:37 -0700]|POST /niku/app?action=nmc.cancelJob HTTP/1.1|302|-|1360|9676430__6dfa03ed:12f6affbe58:-80001303170235992

    From this entry, we can see that from ip address, 130.200.243.199 a Post action for the nmc.cancelJob was received by the server. It came from session 9676430 and took 1.36 seconds.

    This new format can be useful in finding actions that take a long time to complete as well as tracking what users were doing at a particular time in the application.

    You can find the app-access logs under the Clarity \logs directory. They have the format, app-access-yyyy-mm-dd.log. i.e. app-access-2011-04-18.log

    Enjoy!

    -shawn


  • 2.  RE: CA Clarity Tuesday Tip: Enhanced App-Access Logs in 12.1.0

    Posted Jun 22, 2011 11:15 AM
    Very nice - Thank you


  • 3.  RE: CA Clarity Tuesday Tip: Enhanced App-Access Logs in 12.1.0

     
    Posted Jun 22, 2011 02:01 PM
    Thank you for sharing this valuable information Shawn!

    Chris


  • 4.  RE: CA Clarity Tuesday Tip: Enhanced App-Access Logs in 12.1.0

    Posted Jun 22, 2011 02:09 PM
    This is really great - Thanks Shawn... I appreciate it


  • 5.  RE: CA Clarity Tuesday Tip: Enhanced App-Access Logs in 12.1.0

    Posted Jul 28, 2011 03:40 AM
    Shawn,

    This looks like great info, however we don't see this type of layout in our App-Access logs. We are missing in particular the "Elapsed Time" information, which we can use in investigation of performance.

    We are using Clarity 12.1 on Apache Tomcat. Are there any other pre-requisits?

    Michiel Meijler


  • 6.  RE: CA Clarity Tuesday Tip: Enhanced App-Access Logs in 12.1.0

    Posted Aug 12, 2011 07:14 AM
    Hi Shawn,
    thanks for the information. In 12.0, this log also used to include the user ID directly, which made it very easy to see which user made the request without having to query the sessions tables. Is there a way to add that attribute back to the log?

    Thanks!

    -Tom


  • 7.  RE: CA Clarity Tuesday Tip: Enhanced App-Access Logs in 12.1.0

    Posted Aug 12, 2011 07:59 PM
    Tom,

    The app-access logs don't show the username in the session, however, you can sometimes determine that from the context of the requests (the parameters) Also you can use the session token to track back to the user id using the following:

    In the app-access log, you'll see entries like:

    130.100.143.156|[11/Aug/2011:15:21:15 -0700]|GET /niku/app?action=nmc.userSelectInstanceRightType&resourceId=1&id=1&principal=USER HTTP/1.1|200|4582|234|5431144__5418a09e:131bae394a5:-80001313100502181
    130.100.143.156|[11/Aug/2011:15:21:22 -0700]|POST /niku/app?action=nmc.userAddInstanceRights&resourceId=1&id=1&principal=USER&resourceId=1 HTTP/1.1|200|5273|188|5431144__5418a09e:131bae394a5:-80001313100502181

    You can track back to the user by looking at the session id token: i.e. 5431144__5418a09e:131bae394a5:-80001313100502181

    Then take the number before the double underscore (__), which is 5431144.

    Finally, you can locate that user by selecting into the cmn_sessions table.

    i.e.

    select user_id from cmn_sessions where id = 5431144.

    -shawn


  • 8.  RE: CA Clarity Tuesday Tip: Enhanced App-Access Logs in 12.1.0

    Posted Jan 09, 2014 11:52 AM

    Instead of CMN_SESSIONS, if you use the previous number  "5431144" as SESSION_ID in table CMN_SESSION_AUDITS you could identify a user session even when the session is closed and the  job "Clean User Session" has not been executed yet, (I think by default is daily) .

    Increasing the period of time between job executions would allow identify older user session but would impact in performance.

    Is there any other alternative in order to verify logon or activity on Clarity service?