Back

Topic

[KB1114]How to filter events and continue to display users logon and logoff?

Tags: Events, HDS, Log viewer, Logoff, LogViewer

3 years ago
By LM
Options
Print
Applies to:

PcVue 10 SP2 onwards


Summary:

Using the PcVue logviewer dialog box, it is possible to filter the events according to their nature while also displaying the connections and disconnections of users, at least if the logs are archived in proprietary format.

This does not work if the logs are in database format (HDS). This is because HDS is using SQL filtering syntax to filter the events.
When you filter the data in a table using a column that can be NULL in the WHERE condition, all rows with a NULL value in that column will be excluded, regardless of the WHERE condition. The exception is when you specifically request IS NULL values.

This article explains how to achieve this using a Scada Basic statement.


Details:

In order to filter the events according to their nature while also displaying the connection and disconnection operator actions, the Scada Basic LOGDISPLAY instruction must be used with it FILTER mode as follows:

LOGDISPLAY(“FILTER”, “MimicName”, “Branch”, “LogId”, “Nature = ‘FIRE’ OR Nature IS NULL“)

The PcVue help details the role of each of this function’s parameters. Here, it is the last parameter “Filter” that interests us :
“Nature = ‘FIRE’ OR Nature IS NULL
The nature of the events must be ‘FIRE’ or it must be NULL.

Indeed, if we observe the contents of the event table in the database, we can see that the NATURE field is NULL for the records of type ‘logon/logoff’:
Database content

Another syntax that can be useful too:
“Nature <> ‘FIRE’ OR Nature IS NULL
All natures except FIRE or the nature is NULL.

This method is also working for filtering on the domain property.



 

Created on: 15 Jun 2021 Last update: 30 May 2024