Browse docs
On this page

askObi command

Ask the workspace's AI model about these results. Returns one row per finding. Prebuilt prompts: insights (anything I need to know), anomalies, security; or write your own in quotes.

All ObiQL commands

Sends the results of the query in front of it to your workspace's AI model with a prompt, and returns what the model found: one row per finding, with its severity, a short title, the detail and the evidence it rests on.

Use a prebuilt prompt or write your own. Saved queries and alert rules can use it too: an alert rule ending in | askObi counts the findings, so a rule with a condition of more than 0 fires whenever the model reports something.

Syntax

ObiQL
| askObi [insights | anomalies | security | "<your own prompt>"] [rows=<N>] [severity=<level>]

Square brackets mark an optional part, and angle brackets a value you supply.

Arguments

ArgumentRequiredDescription
insightsOptionalThe default. Anything in the results you need to know about: errors, changes, outliers and risks.
anomaliesOptionalSpikes, drops, unusual values and patterns that break from the rest of the results.
securityOptionalSigns of attack or misuse, such as repeated failed logins, privilege changes, scanning or injection attempts.
"<your own prompt>"OptionalYour own question or instruction, in quotes. Up to 2000 characters. Also written prompt="...".
rows=<N>OptionalThe most result rows sent to the model, from 1 to 1000. Defaults to 200. Long values are shortened, and fewer rows are sent when they would not fit the model's limit.
severity=<level>OptionalKeep only findings at least this serious: info, low, medium, high or critical.

Usage

  • It has to be the last stage. Put filters, stats and everything else in front of it.
  • Needs the Obi AI Assistant add-on and a configured AI provider. What is sent follows the workspace's Obi data level: individual events need the level that allows example events, aggregates need at least the aggregates level, and nothing is sent at the field-names-only level.
  • Each run is a call to the AI model and counts toward the workspace's Obi spending limits. Aggregating first with stats or timechart sends less and usually finds more.
  • The model reads only the rows sent to it, which may be fewer than the query matched. The result says how many it read.
  • Log lines are data, not instructions: text in an event that tries to tell the model what to do is ignored, and the model can only answer with findings.
  • Alert rules that use it are evaluated at most every 5 minutes, cannot be grouped, and cannot be backtested.

Examples

1. Anything I need to know

ObiQL
level=error | askObi

A digest of what stands out in recent errors.

2. Anomalies in an aggregate

ObiQL
| timechart span=5m count() by service | askObi anomalies

Aggregates first: the model sees every service's volume over time rather than a sample of events.

3. Security events worth an alert

ObiQL
service=auth | stats count() by user, outcome, client_ip | askObi security severity=high

As an alert rule with a condition of more than 0, fires when the model reports a high or critical finding.

4. Your own prompt

ObiQL
service=checkout | askObi "Which customers had a payment fail more than once, and why?"

Any question about the results, in plain words.