sonar-users

Retrieves the list of accounts registered in Logpresso Sonar. There are no options; running it returns all registered accounts.

Command properties

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

Syntax

sonar-users

Output fields

FieldTypeDescription
guidstringA 36-character unique identifier
loginstringThe account name used for authentication
namestringThe account user's full name
titlestringThe account user's job title or position
deptstringThe department the account user belongs to
phonestringThe account user's landline phone number
mobilestringThe account user's mobile phone number
emailstringThe account user's email address
localestringThe account user's default language setting (en or ko)
role_idintegerThe account's role ID (0: guest, 1: cluster administrator, 2: company administrator, 3: user)
role_namestringThe account's role name
home_menu_idintegerThe default menu ID to display after login
granted_tablesarrayThe list of table permissions the account can access
user_granted_profilesarrayThe list of connection profile usage permissions granted to the account
group_granted_profilesarrayThe list of connection profile usage permissions granted to the groups the account belongs to
user_group_guidsarrayThe list of GUIDs of the groups the account belongs to
trust_hostsarrayThe list of IP addresses allowed to log in to the account (access control list)
idle_behaviorstringThe protective action for an idle session (lock: lock the screen, logout: automatic logout)
idle_timeoutintegerThe time threshold (in seconds) used to determine an idle session (0 means unlimited)
password_expirationintegerThe password change requirement period (-1: system default, 0: unlimited, 7-3650 days)
last_pw_changetimestampThe date and time of the account's last password change
login_lock_countintegerThe maximum number of consecutive failed login attempts before the account is locked (0-5)
login_lock_intervalintegerThe time it takes for the account to unlock automatically after being locked (1-100000000 minutes)
login_lock_untiltimestampThe time when the account lock is scheduled to be released. null if the release time has already passed
login_fail_countintegerThe number of consecutive login failures. 0 if the lock release time has already passed
last_logintimestampThe account's last login time
auth_modeintegerThe selected authentication method (0: internal/external authentication, 1: external authentication only)
has_api_keybooleanWhether an API key has been issued for the account. Does not include the API key value itself
preferencesmapThe account's personalized preference settings
otp_enabledbooleanWhether OTP authentication is enforced when logging in to the account
otp_registeredbooleanWhether the user has registered an OTP device to the account
createdtimestampThe time the user account was created
updatedtimestampThe time the user account was last modified

Error codes

Parsing errors
Error codeMessageDescription
300165No permission to enumerate users.Run in a session without administrator permission
Runtime errors

N/A

Description

sonar-users is an administrator-only command that retrieves every account registered in Logpresso Sonar. Running it in a session without administrator permission causes an error at the parsing stage and the query does not run.

The output fields include a number of attributes directly tied to account security, such as granted_tables (table permissions), trust_hosts (access control list), login lock/failure status, and OTP registration status. However, output is restricted to the same fields exposed by the REST API, so the password hash and the API key value itself are not included; the has_api_key field only lets you check whether an API key has been issued. Because of this nature, be careful not to leak account security attributes when sharing query results with other users or exposing them on a dashboard.

If the unlock time recorded in login_lock_until has already passed, the account is treated as if it were actually unlocked, so login_lock_until is returned as null and login_fail_count is returned as 0.

Examples

  1. Query all registered accounts

    sonar-users
    
  2. Filter only accounts with an administrator role

    sonar-users
    | search role_id == 1 or role_id == 2
    | fields login, name, role_name, dept, email
    
  3. Check accounts that are locked or have not registered OTP

    sonar-users
    | search login_lock_until not null or (otp_enabled == true and otp_registered == false)
    | fields login, name, login_lock_until, login_fail_count, otp_enabled, otp_registered
    
  4. Aggregate the number of accounts by role

    sonar-users
    | stats count by role_name
    | sort -count
    

Change history

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