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
| Property | Description |
|---|---|
| Command type | Driver query |
| Required permission | Administrator |
| License usage | Counted |
| Parallel execution | Not supported |
| Distributed execution | Runs on Data Node (mapper) |
Syntax
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, orzh. 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
| Field | Type | Description |
|---|---|---|
| code | string | Schema code |
| name | string | Schema name (the display name for the specified language when the locale option is applied) |
| description | string | Schema description |
| app_code | string | App identifier |
| app_built_in | boolean | Whether the log schema object is included in an app |
| created | timestamp | Creation time |
| updated | timestamp | Last update time |
Error codes
Parsing errors
| Error code | Message | Description |
|---|---|---|
| 300146 | No 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
-
Retrieve the full list of log schemas
sonar-log-schemas -
Search by keyword
sonar-log-schemas keywords="session" -
Query display names in English
sonar-log-schemas locale="en" -
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.