Kaspersky Security Center

Creating an SQL query using the klsql2 utility

May 3, 2024

ID 151343

This section describes how to use the klsql2 utility, and create an SQL query by using this utility. Use klsql2 utility version that is included in your Kaspersky Security Center Linux version installed.

To use the klsql2 utility:

  1. Go to /opt/kaspersky/ksc64/sbin/klsql2 directory on the device with Kaspersky Security Center Administration Server installed.
  2. In this directory, create src.sql blank file.
  3. Open the src.sql file in any text editor.
  4. In the src.sql file, type the SQL query that you want, and then save the file.
  5. On the device with Kaspersky Security Center Administration Server installed, in the command line, type the following command to run the SQL query from the src.sql file and save the results to the result.xml file:

    sudo ./klsql2 -i src.sql -u <username> -p <password> -o result.xml

    where <username> and <password> are credentials of the user account that has access to the database.

  6. If required, enter the login and password of the user account that has access to the database.
  7. Open the newly created result.xml file to view the query results.

You can edit the src.sql file and create any query to the public views. Then, from the command line, execute your query and save the results to a file.

See also

Scenario: configuring event export to SIEM systems

Did you find this article helpful?
What can we do better?
Thank you for your feedback! You're helping us improve.
Thank you for your feedback! You're helping us improve.