sonar-datasets

Retrieves the list of all datasets registered in Logpresso Sonar. Also returns properties such as each dataset's GUID, name, type, owner, and sharing targets.

Command properties

PropertyDescription
Command typeDriver query
Required permissionAdministrator
License usageCounted
Parallel executionNot supported
Distributed executionNot supported

Syntax

sonar-datasets

Options

None

Output fields

FieldTypeDescription
guidstringDataset GUID
namestringDataset name
descriptionstringDataset description
typestringDataset type. One of query (query-based) or pivot (pivot-based)
owner_guidstringGUID of the dataset owner
owner_namestringName of the dataset owner
app_codestringThe code of the app the dataset belongs to. null for datasets created directly, independent of any app
shared_usersarrayList of shared users. Each item is an object with guid, name, type, read_only, and created fields, where created is a string in yyyy-MM-dd HH:mm:ssZ format rather than a timestamp value
shared_groupsarrayList of shared user groups. Each item is an object with guid, name, type, read_only, and created fields, where created is a string in yyyy-MM-dd HH:mm:ssZ format rather than a timestamp value
createdtimestampCreation date
updatedtimestampLast modification date

Error codes

Parsing errors
Error codeMessageDescription
300172No permission to list datasetsRun by an account without administrator permission
Runtime errors

N/A

Description

The sonar-datasets command targets all registered datasets, without any filter. Because it runs with administrator permission, all datasets are returned regardless of owner or sharing settings, and on installations with multiple companies (tenants) registered, datasets from other companies are included as well. It also includes datasets that widgets reference and datasets that you can run with the dataset command, so to check specific datasets only, you must chain a search or fields command afterward to filter.

To clone a dataset you have queried, use the sonar-clone-datasets command.

Examples

  1. Retrieve the full list of datasets

    sonar-datasets
    

    Returns the properties of every dataset registered in the system.

  2. Aggregate the count of datasets by type

    sonar-datasets
    | stats count by type
    

    Groups datasets by the query and pivot types and aggregates the count.

  3. Query only datasets that belong to a specific app

    sonar-datasets
    | search app_code == "threat-intel"
    

    Filters only datasets created by the app whose app_code is threat-intel.

Change history

The sonar-datasets command is available in the Sonar 4.0 series starting with 4.0.2609.0, where the command previously provided by the Experimental app was built into Sonar core. On versions without the built-in command, install the Experimental app to use it.