sonar-ai-generate-dashboard

Sends a natural language prompt to a Logpresso AI Assistant connect profile to automatically generate a dashboard. Use this command when security operations users want to quickly create a dashboard with widget configurations and queries from a natural language request, without designing the dashboard layout and queries manually. A Logpresso AI Assistant connection profile must be configured beforehand.

Command properties

ItemDescription
Command typeDriver query
Required permissionNone
License usageCounted
Parallel executionNot supported
Distributed executionNot supported

Syntax

sonar-ai-generate-dashboard prompt=STR [profile=STR] [dashboard-name=STR] [debug=BOOL] [dry-run=BOOL]

Options

prompt=STR
Natural language sentence describing the dashboard generation request. Describes which data to visualize and in what form.
profile=STR
Name of the Logpresso AI Assistant connect profile. When omitted, an available profile is selected automatically. Specifying more than one profile causes an error.
dashboard-name=STR
Forces a specific name for the generated dashboard. When omitted, the AI assigns a name based on the prompt.
debug=BOOL
When set to t, debug messages from the processing steps are also included in the output records (default: f).
dry-run=BOOL
When set to t, performs only a simulation without actually creating the dashboard or its widgets (default: f).

Output fields

FieldTypeDescription
_timedateEvent time
profilestringName of the Logpresso AI Assistant connect profile used
levelstringLog level (info, debug, error)
modulestringName of the processing module
msgstringProgress or result message
statusstringProcessing status (success, failure)
errorstringError message on failure (empty for successful records)

Error codes

Parse errors
Error codeMessageDescription
212200사용 가능한 SLLM 프로파일이 없습니다.No Logpresso AI Assistant connect profile is registered, or the user has no permission to access one
212202하나의 프로파일만 지정하세요.More than one profile name was specified in the profile option, separated by commas
212230prompt 옵션을 지정하세요.The required prompt option was not specified or was set to an empty string
Runtime errors

N/A

If an exception occurs during dashboard generation, no error code is raised. Instead, a record with level=error, status=failure, and the message in the error field is emitted.

Description

The sonar-ai-generate-dashboard command sends the natural language request received via the prompt option to the LLM connected to a Logpresso AI Assistant connect profile, generates widget configurations and queries, and registers the result as a new dashboard. Each step of the process is recorded as a progress message in the output fields, and a final success or failure record is appended at the end.

When the profile option is omitted, the first Logpresso AI Assistant connect profile that the user can access is selected automatically from the registered profiles. If no profile is available, an error is raised at the parsing stage. The profile option accepts only a single profile, and specifying two or more profiles separated by commas causes an error.

Use the dashboard-name option to specify the dashboard name directly. When omitted, the AI assigns an appropriate name based on the prompt.

Setting dry-run=t runs the LLM call and planning stages but does not actually create the dashboard or its widgets. Use this to preview the prompt result. Setting debug=t also emits detailed messages from internal processing steps as level=debug records, which can be useful for diagnostics.

LLM call results are non-deterministic, so the generated widget configurations, queries, and dashboard name can differ on each execution even with the same prompt.

Usage examples

  1. Generate a dashboard from a natural language prompt

    sonar-ai-generate-dashboard prompt="Create a dashboard that shows web server access trends and status code distribution over the last 24 hours"
    

    The AI interprets the prompt, generates widget configurations and queries, and registers a new dashboard. Step-by-step info records are emitted in order, followed by a final success message that includes the generated dashboard name and GUID.

  2. Generate a dashboard with an explicit name and connect profile

    sonar-ai-generate-dashboard profile="ai-default" prompt="Visualize the top 10 source IPs by hour and the total response bytes" dashboard-name="Web Traffic Summary"
    

    Generates the dashboard through the specified ai-default profile, and the resulting dashboard name is fixed to Web Traffic Summary.

  3. Preview the result with simulation mode and debug messages

    sonar-ai-generate-dashboard prompt="Widgets for HTTP 4xx and 5xx error trends" dry-run=t debug=t
    

    Reviews only the plan produced by the LLM without actually creating a dashboard or widgets. The debug=t option also emits detailed messages from each processing step as level=debug records.

Compatibility

The sonar-ai-generate-dashboard command is available since Sonar version 5.0.2603.0.