Applies to:
Denodo 8.0
,
Denodo 7.0
,
Denodo 6.0
Last modified on: 22 May 2020
Tags:
Administration
Monitoring
Goal
This document explains how to use the Denodo Log Custom Wrapper in order to read the Denodo Server logs. This approach can be useful when there is no direct access to a remote server environment.
Importing the custom wrapper into VDP
The component is available to download for support users in the Downloads > Denodo Connects section of the Support site.
In order to use the Log Custom Wrapper in VDP, we must configure the Design Studio Tool to import the extension. From the log-customwrapper distribution, we will select the jar file and upload it to VDP. To do this:
Go to File → Extension management and create a new item selecting the jar file.
Creating a Data Source
Once the custom wrapper jar file has been uploaded to VDP using the Design Studio Tool, we can create a new data source for this custom wrapper --and its corresponding base view-- as usual.
Go to File, New → Data Source → Custom and specify the Data Source name ds_vdp_logs. Check ‘Select Jars’, select the jar file of the custom wrapper,
select com.denodo.connect.log.LogCustomWrapper as the wrappers’ class name, then click Refresh Input Parameters of the data source.
Creating a Base View
Once the custom wrapper has been registered, we will be asked by Design Studio to create a base view for it.
In order to create our base view, we will have to specify:
Optionally
NOTE: If you enter a literal that contains one of the special characters used to indicate interpolation variables (“@”, “{“ or “}”), in a parameter that accepts interpolation variables, you have to escape these characters with “\”.
In the example:
com.denodo.connect.log.rollingpolicy.DefaultLogRollingPolicy
By clicking on the Configure button, you can choose the path of the log file, if you choose any of the Decompress options, you will most probably need to change the Rolling policy.
The custom wrapper detects the output fields according to the groups of the extractor pattern.
We want to integrate a VDP log, where an example of line is
1 [RMI(179)-192.168.0.20-12] ERROR 2020-05-05T13:45:17.302 com.denodo.vdb.catalog.view.View [] - Error loading cache configuration for view
com.denodo.vdb.cache.VDBCacheException: Error loading jdbc data source 'vdpcachedatasource'.
Where the date is 2020-05-05T13:45:17.302, so the Date pattern field would be yyyy-MM-dd'T'HH:mm:ss.SSS and the Date extract pattern field should be able to catch that string to be able to access and search the lines of the log that we want, in this case we have chosen (?:.*?)(\\d*-\\d*-\\d*T\\d*:\\d*:\\d*.\\d*) (?:.*?), because we can see that dates are digits separated by “-” and “:”, with a “T” between the date and the time.
For the Content Extract Pattern we have chosen which fields we want to extract from the log with this regular expression (?:.*?) (.*?)(ERROR) (\\d*-\\d*-\\d*T\\d*:\\d*:\\d*\\.\\d*)(.*?), where we have catched a group before “ERROR” (out0), other with the word “ERROR” (out1), other with the date (out2) and the last one with the rest of the line (out3).
In the line of the example, these are the extracted groups:
When executing the base view, there are two parameters, the start date (mandatory) and the end date (optional).
Also, you can query the view from the VQL Shell. The following query will show all the data in the logs for 2020:
SELECT * FROM testlogs WHERE searchstartdate_0 = 'Jan 01, 2020 12:00:00 AM'
References