Fortinet white logo
Fortinet white logo
8.0.0

Troubleshooting SQL test queries

Troubleshooting SQL test queries

When creating or editing a dataset, click Go to test the query. This will display any errors that are present in the SQL query.

You can click Format to automatically format the entered SQL query in a dataset, making it easier to read, update, and detect errors.

To test a dataset query:
  1. Follow the procedures in Creating datasets or clone an existing dataset.
  2. From the Time Period dropdown, select a time period to use for the test.
  3. From the Devices dropdown, select the devices to use for the test.
  4. Click Go.

    Once the test is finished, the query results are displayed.

  5. Click OK.

If the SQL test is unsuccessful, an error message is displayed to indicate the cause of the problem in the query.

Following are some example error messages and possible causes:

ERROR: syntax error at or near...

  • Check that SQL keywords are spelled correctly and that the query is well-formed. Table and column names are demarked by grave accent (`) characters. Single (') and double (") quotation marks will cause an error.

No Data

  • The query is correctly formed, but no data has been logged for the specified log type. Check that you have configured and authorized a logging device of that type on the FortiAnalyzer.

Troubleshooting SQL test queries

Troubleshooting SQL test queries

When creating or editing a dataset, click Go to test the query. This will display any errors that are present in the SQL query.

You can click Format to automatically format the entered SQL query in a dataset, making it easier to read, update, and detect errors.

To test a dataset query:
  1. Follow the procedures in Creating datasets or clone an existing dataset.
  2. From the Time Period dropdown, select a time period to use for the test.
  3. From the Devices dropdown, select the devices to use for the test.
  4. Click Go.

    Once the test is finished, the query results are displayed.

  5. Click OK.

If the SQL test is unsuccessful, an error message is displayed to indicate the cause of the problem in the query.

Following are some example error messages and possible causes:

ERROR: syntax error at or near...

  • Check that SQL keywords are spelled correctly and that the query is well-formed. Table and column names are demarked by grave accent (`) characters. Single (') and double (") quotation marks will cause an error.

No Data

  • The query is correctly formed, but no data has been logged for the specified log type. Check that you have configured and authorized a logging device of that type on the FortiAnalyzer.