Creating an SQL query using the klsql2 utility
Dec 4, 2023
This section describes how to download and use the klsql2 utility, and how to create an SQL query by using this utility.
To use the klsql2 utility:
- Locate the klsql2 utility in the installation folder of Kaspersky Security Center. Do not use klsql2 utility versions intended for older Kaspersky Security Center versions.
- Create the src.sql file in any text editor and place the file in the same folder with the utility.
- In the src.sql file, type the SQL query that you want, and then save the file.
- 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:
klsql2 -i src.sql -u <
> -p <
> -o result.xml
>are credentials of the user account that has access to the database.
- If required, enter the login and password of the user account that has access to the database.
- Open the newly created result.xml file to view the SQL query results.
You can edit the src.sql file and create any SQL query to the public views. Then, from the command line, execute your SQL query and save the results to a file.