Saving and sharing queries


In BMC Discovery, you can use queries to search the datastore and to create reports and patterns. You can also save queries, share them with other users, and export or import them.

To save a query

You can save a query through Explore > Query option. You can mark the query as favorite, by selecting the Favorite check box. The saved queries are listed on the User Queries tab. For more information about queries, see Searching-your-data.

To perform actions on individual queries

Individual queries in the My Queries and Shared Queries lists have an Actions menu which enables you to perform operations on that query. You can:

Operation

Description

Run 

Run the query.

Edit as new

Use the saved query as the basis for a new query. A copy of the query is opened to edit in the Edit window appropriate to the type of query. The original query is not modified. 

Not available on the Shared Queries view.

Edit saved

Edit the currently selected query in the Edit window appropriate to the type of query.

Not available on the Shared Queries view.

Copy

Make a copy of the query and open it in the Edit window appropriate to the type of query.

Delete

Delete the query. You must confirm the request.

Not available on the Shared Queries view.

To share saved queries

To share queries, perform the following steps:

  1. Go to Explore > Query.
  2. Click the User Queries tab and for the Show field, select My Queries
    A list of saved queries is displayed.
  3. Select the check box for one or more queries that you want to share.
  4. From the Actions menu, select Share.

    sharing_query_01.png

    The shared queries are available under Shared Queries.

    sharing_query_02.png

To unshare queries

To stop sharing a query, perform the following steps:

  1. Go to Explore > Query.
  2. Click the User Queries tab and for the Show field, select My Queries
  3. Select the check box for one or more queries that you want to stop sharing. 
  4. From the Actions menu, select Unshare
    The query is removed from Shared Queries.

To export or import queries

You can export or import queries in XML format. This option helps transfer queries between appliances. This is also useful when you want to preserve queries before deleting the contents of the datastore with model wipe or when setting up a new appliance. Also, if you need to share complex queries with the BMC Support team or across communities, this feature comes in handy.

export_import_queries_113.png

To export a query

  1. Go to Explore > Query.
  2. Click the User Queries tab and for the Show field, select My Queries or Shared Queries, depending on whether you want to export saved queries or only the shared queries.
  3. Select the check box for one or more queries that you want to export.
  4. From the Actions menu, select Export.
    The query is downloaded on your system with a default file name, UserQueries.xml.
    You can use this XML file to transfer the queries between appliances, share with the Support team, or for other purposes.

To import a query

  1. Go to Explore > Query.
  2. Click the User Queries tab and the click Import Queries
    The Import Queries dialog box is displayed.

    import_queries.png

  3. Click Choose File, browse to the folder containing the query XML file that you want to import, and select the file.
  4. Click Import.
    A message, Query import complete is displayed and the query is listed in the My Queries section.



 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*