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
| Item | Description |
|---|---|
| Command type | Driver query |
| Required permission | None |
| License usage | Counted |
| Parallel execution | Not supported |
| Distributed execution | Not supported |
Syntax
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
| Field | Type | Description |
|---|---|---|
_time | date | Event time |
profile | string | Name of the Logpresso AI Assistant connect profile used |
level | string | Log level (info, debug, error) |
module | string | Name of the processing module |
msg | string | Progress or result message |
status | string | Processing status (success, failure) |
error | string | Error message on failure (empty for successful records) |
Error codes
Parse errors
| Error code | Message | Description |
|---|---|---|
| 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 |
| 212230 | prompt 옵션을 지정하세요. | 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 theerrorfield 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
-
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
inforecords are emitted in order, followed by a final success message that includes the generated dashboard name and GUID. -
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-defaultprofile, and the resulting dashboard name is fixed toWeb Traffic Summary. -
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=tReviews only the plan produced by the LLM without actually creating a dashboard or widgets. The
debug=toption also emits detailed messages from each processing step aslevel=debugrecords.
Compatibility
The sonar-ai-generate-dashboard command is available since Sonar version 5.0.2603.0.