sonar-widgets

Retrieves the list of all widgets registered in Logpresso Sonar. Also returns properties such as each widget's GUID, name, render type, refresh interval, owner, and sharing targets.

Command properties

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

Syntax

sonar-widgets

Options

None

Output fields

FieldTypeDescription
guidstringWidget GUID
namestringWidget name
descriptionstringWidget description
render_typestringWidget render type
intervalintegerWidget refresh interval
owner_guidstringGUID of the widget owner. Not returned in the current implementation
owner_namestringName of the widget owner
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
300171No permission to list widgetsRun by an account without administrator permission
Runtime errors

N/A

Description

The sonar-widgets command targets all widgets that belong to the same company (tenant), without any filter. Because the query does not join against tabs, all widgets are targeted regardless of whether they are placed on a dashboard, and because it runs with administrator permission, they are returned regardless of owner or sharing settings as well. To check specific widgets only, you must chain a search or fields command afterward to filter.

To clone a widget you have queried, use the sonar-clone-widgets command.

Examples

  1. Retrieve the full list of widgets

    sonar-widgets
    

    Returns the properties of every widget registered in the system.

  2. Aggregate the count of widgets by render type

    sonar-widgets
    | stats count by render_type
    

    Groups widgets by render type and aggregates the count.

  3. Query only widgets created by a specific owner

    sonar-widgets
    | search owner_name == "Administrator"
    

    Filters only widgets whose owner display name is Administrator. Because owner_name is the account's display name rather than its login name, specify the display name for accounts where it differs from the login name.

Change history

The sonar-widgets 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.