Logging Use Cases

Flexible Logging Use Case

Flexible logging allows you to specify request log record fields that should be written to log files or sent to a remote logger server.  The 'Request Log Record Fields' section found in Policy Server Settings (nsd) allows you to specify request log fields. This global setting specifies the fields set for remote logger, text format and extended binary log files.

Available fields are:

  • url

  • client

  • group

  • policy

  • ip

  • dst

  • denied

  • category

  • interceptor

  • server_id

  • method

  • agent

  • referrer

  • type

  • data

  • module

  • workstation

  • screenshot

  • allcategories

  • deniedcategories

For a complete list, please see the ‘Request Log Record Fields’ settings in Policy Server Settings

Setting up Policy Server

  1. Go to Administration > Configuration and click the Policy Server Settings button.

  2. Scroll down to the’ Request Log Record Fields’ section.

  3. We are going to add the client, policy, interceptor, and server_id, to our fields so add this line under the logger_fields section.

  4. Add

logger_fields interceptor server_id client policy

  1. Click Submit to save the changes and return to the System Configuration window.

  2. Click the Restart Policy Server button.

View Request Log Archives

Generate requests for all the Groups.

  1. Go to Logs > Request Logs and click the Archives tab.

  2. Click on the Archive you wish to view

  1. The file displays with the added fields.

 

Running a Report with Log File Name Tag

If you have log files that are not segmented from earlier releases, Reports will also use these log files. 

Enable Report Filter Fields

You may have to add the ‘Log File Name Tag’ to your Report through the ‘Enabled Report Filter Fields’ section of the WebAdmin Settings.

Modify Policy Server Settings

Go to Administration > Configuration and click the Policy Server Settings link.

Scroll to the bottom of the page to the Setup graph “g1” section. 

Comment out or remove the entries that are there and add these entries.  It should be noted that the entry point in the example below is defined and the multiwriter_macro node is defined as 'mynode'. The mynode defines the logger_field as group. 

lm5_entry entry_point

lm5_multiwriter_macro mynode

logger_logmod5_connect entry_point mynode

mynode->logger_field tag

 

Create the Custom Report

In this example Report,

  1. Go to Reports >Custom Report.

  2. Enter the name Log File Name for School A and add an optional Description.

  3. Select Demand for 'Report Type and set the Start/End date. Set the end date to tomorrow's date

  4. Click the Add Filter link.

  5. Select the field Log File Name Tab, the Condition Equal To, and the Value SchoolA.

  6. Click Save.

  7. Click the Add Summary Group link.

  1. Choose Policy Group for 'Group Data By' and select Request Count for the 'Field'.

  2. Click Add Presentation.

  3. Select the Pie Graph and Labels with Values. Choose Save.

Click Save again to save the 'Summary Group'.

  1. Click Create Report.

  2. The Report will display the two Groups with the 'SchoolA' tag.