sonar-format-log
Converts Sonar operational log messages to the specified language. Transforms the msg field of operational log records into a human-readable message string.
Command properties
| Item | Description |
|---|---|
| Command type | Transforming |
| Required permission | None |
| License usage | N/A |
| Parallel execution | Supported |
| Distributed execution | Runs on Data Node (mapper) |
Syntax
Options
locale=STR- Language to use for message conversion. If not specified, messages are converted to English. (Default:
en)
en: Englishko: Korean
Output fields
All fields from the input record are output unchanged, with the msg field converted to a human-readable message string.
Error codes
Parse errors
N/A
Runtime errors
N/A
Description
The sonar-format-log command converts the msg field of Sonar operational log records into a human-readable message string based on the record content. Sonar operational logs consist of a code and parameters. This command looks up the message template corresponding to the code, substitutes the parameters, and generates the final message.
You can specify the language using the locale option. If not specified, messages are converted to English.
Examples
-
Convert operational log messages to Korean
table duration=1h sonar_system_logs | sonar-format-log locale=koRetrieves Sonar operational logs from the past hour and converts the
msgfield to Korean messages. -
Convert operational log messages to English
table duration=1d sonar_system_logs | sonar-format-logRetrieves Sonar operational logs from the past day and converts the
msgfield to English messages.