Skip to main content
A log source is a log store you already run. Once it is connected to a cluster, Cluster logs → History searches it, and Ankra AI’s query_logs and get_log_labels tools read it during an investigation. Ankra queries the store through the cluster’s agent, so an in-cluster address such as loki-gateway.monitoring.svc works, and so does an external endpoint the agent can reach.
No log store to connect? Where Ankra offers them, Ankra hosted logs keep a cluster’s container logs for up to 7 days with nothing to install. With the Log store filter on Automatic, History reads the store you connect here when there is one, and Ankra hosted logs otherwise.

Supported providers

VictoriaLogs answers on the -server Service of the victoria-logs-single chart, port 9428; victoria-logs-cluster answers on its vlselect Service, port 9471. Ankra sends LogsQL to /select/logsql/query.
Use index-scoped credentials for Elasticsearch and OpenSearch. Ankra’s health check calls {index}/_count, not /_cluster/health, so a least-privilege API key passes. On VictoriaLogs the check is a field_names query, not /health, which answers without credentials, so a read-only credential proves itself the same way.

Before you start

  • A role that holds clusters.write, stacks.write and stacks.delete on the cluster. Without them the Log store panel offers no Connect a log store button. See Roles & Access.
  • The store’s query address, reachable from inside the cluster.
  • A read-only credential for the store, if it needs one.

Connect a log store

The portal connects Grafana Loki, Elasticsearch and OpenSearch. VictoriaLogs is connected from Git, in the GitOps tab.
1

Open the Log store panel

Open Infrastructure → Clusters → <your cluster> → Settings → Integrations (/next/clusters/<cluster-id>/settings/integrations). The Log store panel reads Not connected and lists Grafana Loki · Elasticsearch · OpenSearch.
2

Pick the kind and the address

Click Connect a log store. In Kind, choose Grafana Loki, Elasticsearch or OpenSearch, then fill in Loki address, Elasticsearch address or OpenSearch address: the address the store answers queries on, reachable from inside the cluster. For Grafana Cloud, use the tenant’s query address and an access token. For Elastic Cloud, use the deployment’s address and an API key.
3

Set the provider options

  • Tenant (Loki) - the Loki tenant (X-Scope-OrgID), when your Loki serves several.
  • Index pattern (Elasticsearch and OpenSearch) - which indices hold the cluster’s logs, for example logs-*. Leave it empty to search them all.
  • Check the store’s certificate - turn it off for a store with a self-signed certificate.
  • Field names - open it only when your shipper uses other field names than the defaults in Field mappings.
4

Add the credential

In How Ankra signs in, choose No sign-in, API token (sent as a bearer token), API key (Elasticsearch, sent as an API key as Elastic Cloud expects) or User name and password (basic sign-in). Give it a Credential name: Ankra stores the secret under that name, shows the name on the panel, and never shows the secret again.
5

Test and save

Click Test connection and read the result, then click Save. Ankra tests the connection again before it saves.The panel now shows the Provider, Address and Certificate check, and a status badge: Answering when the health check passes.
Verify: open Technical details → Kubernetes → Cluster logs, choose History, and set Log store in Filters to Your log store. Lines from the store appear, and the badge under the title names the store. See Logs. To change the connection, click Change on the panel. To remove it, click Disconnect and confirm Disconnect this log store?: Ankra stops reading logs from it, and the store itself is not changed.

Field mappings

If you ship logs with Fluent Bit’s kubernetes filter, the Elasticsearch and OpenSearch defaults usually work: Override them under Field names when your index template uses different names. A field left empty takes the default. For VictoriaLogs, the defaults are the store’s reserved fields plus the names Vector’s kubernetes_logs source writes, which is what the victoria-logs charts’ bundled collector ships: Override them with field_mappings in spec.log_source. For Loki, structured filters use label names; the defaults are namespace, pod and container, as Promtail and Alloy write them.

Sharing one log store between clusters

When several clusters ship into one store, each line must say which cluster wrote it, or a search on one cluster returns the others’ lines. Have the shipper stamp every line with a cluster field (Elasticsearch, OpenSearch, VictoriaLogs) or a cluster stream label (Loki) holding the cluster’s name, for example a Fluent Bit record_modifier adding cluster <cluster-name>, or a Promtail or Alloy cluster label. Ankra checks each search window for that field:
  • When lines carry it, the search returns only the lines marked with this cluster’s name. Lines marked for other clusters, and lines with no mark, are left out.
  • When some lines carry it but none for this cluster, the search returns nothing rather than unmarked lines.
  • When no line in the window carries it, the search is not scoped to the cluster.
  • When the check cannot answer, the search is refused: History shows The log store could not confirm these lines are this cluster's.

Managing the log source in Git

If the cluster is connected to a GitOps repository, the log source is part of the cluster document at clusters/<cluster-name>-<cluster-id>/<cluster-name>.yaml. Adding or editing the spec.log_source block connects and updates the source on the next sync, exactly as the settings page does:
Accepted fields are provider, endpoint, credential_name, tenant_id, index_pattern, field_mappings and verify_ssl - see the ImportCluster schema for what each one means. Any other top-level field is refused with an error naming it, rather than ignored, and provider must be loki, elasticsearch, opensearch or victorialogs.
Credentials never go in Git. A username, password, token or auth_scheme inside the block is refused by name: silently ignoring it would leave a live secret in your repository while you believe it is in effect. Create the credential in the platform and reference it with credential_name.Removing the block does not disconnect the log source. Git can create and update the source, never disconnect it - the source survives the sync and the block reappears the next time Ankra regenerates the file. Click Disconnect on the Log store panel instead.

Search the logs

Searching happens on Cluster logs → History: text search, a time window, filters for namespace, pod, container and severity, a Patterns view and Load older lines. Logs covers each control. The portal has no raw query box; Ankra AI’s query_logs takes a raw LogQL, LogsQL or query-DSL query when the structured filters are not enough.

Ankra AI and MCP

With a log source connected, Ankra AI and MCP clients can use:
  • query_logs - search the cluster’s log store over a time window.
  • get_log_labels - list the labels or fields the store can be filtered on, to use before or after a query_logs that returns nothing.
  • connect_log_source - connect the log source Ankra derived from the cluster’s installed add-ons, exactly as a query_logs refusal named it.
These reads go through the cluster’s agent like the portal’s; the store’s credential never reaches the browser. See MCP Tools.
When filters return no lines, ask Ankra AI to call get_log_labels first: your shipper may use other label or field names than the defaults.
The External log viewer panel on the same Integrations page adds a shortcut from each pod to Grafana, Kibana or your cloud console. It opens your viewer; it does not send logs to Ankra.

What can go wrong