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

ItemDescription
Command typeTransforming
Required permissionNone
License usageN/A
Parallel executionSupported
Distributed executionRuns on Data Node (mapper)

Syntax

... | sonar-format-log [locale=STR]

Options

locale=STR
Language to use for message conversion. If not specified, messages are converted to English. (Default: en)
  • en: English
  • ko: 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

  1. Convert operational log messages to Korean

    table duration=1h sonar_system_logs
    | sonar-format-log locale=ko
    

    Retrieves Sonar operational logs from the past hour and converts the msg field to Korean messages.

  2. Convert operational log messages to English

    table duration=1d sonar_system_logs
    | sonar-format-log
    

    Retrieves Sonar operational logs from the past day and converts the msg field to English messages.