sonar-log-schemas

Retrieves the list of log schemas registered in Logpresso Sonar. Log schemas are used for field name conversion and sort order in commands such as log and schema.

Command properties

PropertyDescription
Command typeDriver query
Required permissionAdministrator
License usageCounted
Parallel executionNot supported
Distributed executionRuns on Data Node (mapper)

Syntax

sonar-log-schemas [keywords=STR] [locale=STR]

Options

keywords=STR
A keyword to search for in the code, name, or description
locale=STR
The locale to get the display name from. Specify one of ko, en, ja, or zh. If not specified, uses the locale configured for the session.

Input fields

None (as a driver query, this command can only be used as the first command in a pipeline)

Output fields

FieldTypeDescription
codestringSchema code
namestringSchema name (the display name for the specified language when the locale option is applied)
descriptionstringSchema description
app_codestringApp identifier
app_built_inbooleanWhether the log schema object is included in an app
createdtimestampCreation time
updatedtimestampLast update time

Error codes

Parsing errors
Error codeMessageDescription
300146No permission to enumerate log schemas.Run by an account without administrator permission
Runtime errors

N/A

Description

The sonar-log-schemas command retrieves and sequentially returns all registered log schemas in pages of up to 1,000 records at a time. If you specify the keywords option, it searches across the code, name, and description.

If you specify the locale option, the name field value is replaced with the display name for that language. If you specify an unsupported locale value, it is ignored and the default name is returned; even for a supported locale, if there is no translation for that language, the default name is used instead. If the locale option is not specified, the current session's locale setting is followed.

Examples

  1. Retrieve the full list of log schemas

    sonar-log-schemas
    
  2. Search by keyword

    sonar-log-schemas keywords="session"
    
  3. Query display names in English

    sonar-log-schemas locale="en"
    
  4. Query only log schemas included in an app

    sonar-log-schemas
    | search app_built_in == true
    | fields code, name, app_code
    

Change history

The sonar-log-schemas 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.