Managing Past Queries

From the Past queries page, you can view a list of queries that have been run recently, and you can perform many useful operations on an individual query.

    1. Open the navigation menu and click Identity & Security. Under Cloud Guard, click Queries.
    2. On the Queries page, click Past queries.
    3. (Optional) Filter the list by Query status, and by date range (From, To) that the query was run.
    4. Use the column headers to locate a query of interest:
      • Query: the actual SQL command in the query.
      • Scope: Target or Instance.
      • Resources: further refinement of Target or Instance specification.
      • Status: Partially Completed, Completed, Expired, Failed.

        When the status is Partially Completed, Expired, or Failed you can click View Details to see the status of each region that the query ran in.

      • Created by: user who created the query.
      • Time created: the date and time the query was created.
    5. From the Actions menu Image of Action menu select:
      • View results to see the results of the query, on the Run query page.
        Note

        Only fully applicable when Status is Completed.
        • For Status of Partially complete, the results are not complete.
        • For Status of Creating, Expired or Failed, no results are available.
      • Download results to download the query results in a CSV file that you can open in a spreadsheet.
        Note

        Only fully applicable when Status is Completed.
        • For Status of Partially complete, the results are not complete.
        • For Status of Creating, Expired or Failed, no results are available.
      • Re-execute to run the query again.

        A new query entry is created at the top of the list, with your user name in the Created by column, and an initial Status of Creating.

      • Copy query to copy the text of the SQL command to the clipboard.
      • Add to favorites to add the query to the favorites list.
      • Create scheduled query to run this query at scheduled intervals.
  • For a complete list of flags and variable options for CLI commands, see the Command Line Reference.

    Queries

    Use the oci cloud-guard adhoc-query delete command and required parameters to delete a query:

    oci cloud-guard adhoc-query delete --adhoc-query-id <query_ocid> [OPTIONS]

    Use the oci cloud-guard adhoc-query get command and required parameters to get the details for a specific query:

    oci cloud-guard adhoc-query get --adhoc-query-id <query_ocid> [OPTIONS]

    Use the oci cloud-guard adhoc-query list command and required parameters to list all available queries in a compartment:

    oci cloud-guard adhoc-query list --compartment-id, -c <compartment_ocid> [OPTIONS]

    Query Results

    Use the oci cloud-guard adhoc-query-result-collection get-adhoc-query-result-content command and required parameters to download results for a specific query to a file:

    oci cloud-guard adhoc-query-result-collection get-adhoc-query-result-content  --adhoc-query-id <query_ocid> --file <file_name> [OPTIONS]

    Use the oci cloud-guard adhoc-query-result-collection list-adhoc-query-results command and required parameters to list results for a specific query:

    oci cloud-guard adhoc-query-result-collection list-adhoc-query-results --adhoc-query-id <query_ocid> --compartment-id, -c <compartment_ocid> [OPTIONS]

    Query Favorites

    Use the oci cloud-guard saved-query create command and required parameters to add a query to the favorites list:

    oci cloud-guard saved-query create --compartment-id, -c <compartment_ocid> --display-name <saved_query_display_name> --query-parameterconflict <query_expression> [OPTIONS]
  • Queries

    Run the DeleteAdhocQuery operation to delete a query.

    Run the GetAdhocQuery operation to get the details for a specific query.

    Run the ListAdhocQueries operation to list all available queries in a compartment.

    Query Results

    Run the GetAdhocQueryResultContent operation to download results for a specific query to a file.

    Run the ListAdhocQueryResults operation to list results for a specific query.

    Query Favorites

    Run the CreateSavedQuery operation to add a query to the favorites list.