On this page
Saved Queries
Keep an ObiQL query and time range, share it with a workspace, or use it as the live source for an alert rule.
A saved query keeps a name, an ObiQL query, a default time range, and its data source. Use one when a useful investigation should be repeatable without copying query text between people or tools.
Save and reopen a query
Run a query in the Log Explorer, select Save query, then choose a name, default range, and visibility. An empty query is valid and means every event. Save as New creates another saved query when the Explorer already has one loaded.
Open Saved Queries to run, edit, duplicate, or delete saved queries visible
to you. A loaded query uses /explorer?saved=<id>, so the link resolves the
query's current contents rather than preserving an old copy. Explicit q
and range parameters in that URL take precedence. If you change the loaded
query or range, the Explorer marks it Edited and offers three choices:
- Update writes the query and range back to the saved query.
- Revert restores the saved values.
- Detach keeps the current query but stops associating it with the saved query.
Private and shared queries
New saved queries are private by default. A private query is visible only to its owner. A shared query is visible to every member of the workspace, but only its owner can edit, change visibility, or delete it.
Any member who can see a saved query can duplicate it. The copy is always private and belongs to the person who made the copy. There are no public links, per-person shares, folders, tags, or favourites.
Logs and activity history
The source is stored separately from the ObiQL text:
- Logs queries regular ingested events and is the default.
- Activity queries the workspace's activity and security history.
The selected source decides which fields ObiQL validates and searches. Changing the source does not translate a query written for the other schema.
Use a saved query in an alert rule
An alert rule can link to a shared saved query. The link is live: each evaluation reads the saved query's current query and source. Editing the query therefore changes what the rule evaluates without copying query text into the rule.
A linked query cannot be deleted. The Saved Queries table names the rules using it; repoint or unlink those rules first. Saved queries do not run on a schedule or send notifications by themselves, and they are not dashboard panel sources.
API
Personal sessions and personal access tokens can use the same endpoints as the UI:
curl https://api.obistack.com/v1/saved-searches \
-H "Authorization: Bearer <personal access token>" \
-H "Content-Type: application/json" \
-X POST \
-d '{
"name": "Payments errors",
"query": "level:error service:payments",
"defaultRange": "1h",
"visibility": "shared",
"source": "logs"
}'
Names are limited to 200 characters, queries to 10,000, and default ranges to 50. GET /v1/saved-searches?q=payments filters visible saved queries by name.
Create, get, update, and delete operations are listed in the
API reference.
Tenant Isolation & Data Boundaries
The authenticated session or token supplies the workspace. No saved query request accepts a workspace or tenant id. Database row security confines the rows to that workspace; private/shared visibility is then enforced inside the workspace. Asking for another member's private query returns the same 404 as an id that does not exist, so the request does not reveal that it exists. See Tenant Isolation for the full model.