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
| Property | Description |
|---|---|
| Command type | Driver query |
| Required permission | Administrator |
| License usage | Counted |
| Parallel execution | Not supported |
| Distributed execution | Not supported |
Syntax
Options
None
Output fields
| Field | Type | Description |
|---|---|---|
| guid | string | Widget GUID |
| name | string | Widget name |
| description | string | Widget description |
| render_type | string | Widget render type |
| interval | integer | Widget refresh interval |
| owner_guid | string | GUID of the widget owner. Not returned in the current implementation |
| owner_name | string | Name of the widget owner |
| shared_users | array | List 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_groups | array | List 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 |
| created | timestamp | Creation date |
| updated | timestamp | Last modification date |
Error codes
Parsing errors
| Error code | Message | Description |
|---|---|---|
| 300171 | No permission to list widgets | Run 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
-
Retrieve the full list of widgets
sonar-widgetsReturns the properties of every widget registered in the system.
-
Aggregate the count of widgets by render type
sonar-widgets | stats count by render_typeGroups widgets by render type and aggregates the count.
-
Query only widgets created by a specific owner
sonar-widgets | search owner_name == "Administrator"Filters only widgets whose owner display name is
Administrator. Becauseowner_nameis 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.