Onboard an SLS Logstore

Updated at:

Log Insight ingests log data from SLS Logstores into UModel, enabling you to correlate logs with entities and metrics for unified querying and analysis.

Features

Log Insight supports the following capabilities:

  • Query logs by entity: Select a Pod entity to view all logs generated by that Pod.

  • Correlate logs with metrics: When a metric anomaly is identified for an entity, navigate directly to the corresponding log query with a single click.

  • Semantic field configuration: Add structured metadata to log fields, including display names, descriptions, and data types.

  • Unified management view: View the relationships between logs and other data sources on the Log Insight homepage and in UModel Explorer.

Key concepts

Review the following key concepts before using Log Insight.

image.png

Concept

Description

LogSet

A UModel node type representing a collection of log data. A LogSet typically corresponds to a specific business log type, such as user service access logs. Core properties include metadata and spec.fields (field definitions).

SLS Logstore

A UModel node type representing log storage. It corresponds to a specific Logstore and records information such as the Project, Logstore name, and region.

StorageLink

Links a LogSet to an SLS Logstore. A LogSet can be associated with one or more Logstores.

DataLink

Links a LogSet to an EntitySet. It defines field mappings through fields_mapping, and entity filtering conditions through filter_by_entity.

Procedure

Step 1: Select a Project and Logstore

  1. Log in to the Cloud Monitor 2.0 console, select the target workspace, and in the navigation pane on the left, choose All Features > Log Explorer.

  2. Click Manage LogStore.

  3. Select an SLS Project and Logstore. The system checks for related UModel nodes. Then, click Next.

    • Duplicate detection for SLS Logstore nodes: The system matches existing SLS Logstore nodes based on spec.project + spec.store. If a match is found, you can select one of the following operations:

      Option

      Description

      Reuse existing node

      Use the existing SLS Logstore without creating a new node.

      Create new node

      Ignore the existing node and create a new SLS Logstore.

    • Duplicate detection for LogSet nodes: The system checks if a LogSet node related to the selected Logstore already exists. If a match is found, you can select one of the following operations:

      Option

      Description

      Reuse (do not overwrite)

      Use the existing LogSet and keep its current field definitions.

      Overwrite

      Overwrites the existing LogSet with the newly generated field definitions.

      Create new node

      Create a new LogSet.

Step 2: Configure the LogSet

Configure the metadata and field structure for the LogSet, then click Next.

Metadata configuration

Parameter

Description

UModel domain

Isolates UModels for different services. The default value is sufficient in most cases.

LogSet name

The system automatically generates the name in the format {Domain}.{Project}_{LogStore}.

Display name

A display name in Chinese and English. Use a human-readable name that reflects its business purpose.

Description

A brief summary of the LogSet's purpose.

Automatic field discovery

The system discovers fields by performing the following operations in parallel:

  1. Get index configuration: Reads fields from the SLS index settings.

  2. Sample log data: Retrieves and parses fields from recent log samples (10 by default).

    Note

    Remove unneeded fields, such as __source__ and __time__, to simplify the LogSet schema and improve query performance.

The merge rules are as follows:

  • Indexed field priority: Indexed fields are marked as filterable and analyzable.

  • Note on log samples: Fields that exist in logs but are not in the index are also extracted, but are marked as unavailable for analysis.

  • Nested field support: Recursively parses the internal structure of JSON fields.

Fields

Column

Description

Attribute name

The original field name. This value cannot be modified.

Display name

The display name of the field. By default, it is the same as the attribute name.

Description

A description of the field.

Sample value

A value extracted from log samples.

Field type

Supported types include string, integer, float, json_object, and time.

Filterable

Indicates if the field can be used in filters. This usually requires an index.

Analyzable

Indicates if the field supports aggregate analysis. This usually requires an index with statistics enabled.

Field types

Type

Description

string

A string. Supports full-text search and exact matches.

integer

An integer. Supports range queries and aggregate calculations.

float

A floating-point number. Supports range queries and aggregate calculations.

json_object

A nested JSON object. Its internal fields are expanded.

time

A time value. Supports time range queries.

Note

If a Logstore lacks configured indexes and has no log data from the last 24 hours, the system reports that it cannot be explored.

Step 3: Associate an EntitySet

Associate the LogSet with an EntitySet by creating a DataLink.

Select an EntitySet

The system lists all EntitySet nodes in the current workspace. Common scenarios include:

  • Associating application service logs with service entities by matching serviceName.

  • Associating container logs with Pod entities by matching podName.

  • Associating host logs with host entities by matching hostname.

    Note

    Logs for a single service: Preferentially associated with the corresponding service EntitySet.

    Container logs: Associate these logs with the Pod EntitySet, and then associate the Pod with the service.

Configure fields_mapping

The fields_mapping setting maps log fields to entity fields.

Example configuration

"fields_mapping": {
  "name": "serviceName",
  "region_id": "region_id"
}

This configuration maps the serviceName field from the logs to the name field of the entity, and directly maps the region_id field.

Filter for a subset of entities

To associate logs with a subset of entities, define a filter in the filter_by_entity field. Then, click Complete and Submit to create the UModel nodes.

filter_by_entity uses the SPL where clause syntax for its filter conditions.

Example 1

language = 'java' filters for all entities where language is java.

Example 2

file_system_type in ('extreme', 'standard') AND json_extract_scalar(entity_groups, '$.eg-01') = 'true' AND region_id='cn-hongkong' AND engine='MySQL'

This filters for entities that meet all the preceding conditions.

(Optional) Step 4: Create a new StorageLink

You can also create a StorageLink separately. This is useful in the following scenarios:

  • You have an existing LogSet and need to associate it with a new LogStore.

  • Logs of the same type are in multiple Logstores, and you need to associate them one by one.

In the LogSet List, select the target LogSet. In the Actions column, click the plus sign (+), and then click Add Associated SLS LogStore.

Field comparison

When you create a StorageLink, the system automatically compares the field definitions of the LogSet with the index fields of the LogStore.

Status

Description

Match

The field name and type are identical.

In LogSet / Not in LogStore

The field is defined in the LogSet but not in the LogStore index.

In LogStore / Not in LogSet

The field is in the LogStore index but not defined in the LogSet.

Note
  • If a field exists in the LogSet but not in the LogStore and is configured to be filterable, queries on that field return a "field does not exist" error.

  • Fields that exist in the LogStore but not in the LogSet do not appear in the field list for structured queries.

Step 5: Manage and view the log list

After onboarding is complete, you can manage all LogSets from the log list page.

List description

Column

Description

StorageLink status

Shows the number of associated SLS Logstores and whether the associations are complete.

DataLink status

Shows the number of associated EntitySets.

Status icon descriptions:

Icon

Description

Green check mark

The association is normal.

Yellow exclamation mark

Indicates an incomplete association, such as when an associated node does not exist.

Special icon

The filter_by_entity setting is active. Only some entities are associated.

Advanced filtering

Filter LogSets by multiple dimensions.

General filtering

  • Filter UModels created by the assistant

  • Filter UModels that contain CommonSchema

StorageLink filtering

  • Not associated with any SLS Logstore

  • Contains incomplete edges

  • Contains multiple StorageLinks

  • Contains links that are effective for only some entities

DataLink filtering

  • Not associated with any EntitySet

  • Contains incomplete edges

  • Contains multiple DataLinks

  • Contains links that are effective for only some entities

Full-text search

Supports full-text search on LogSet, StorageLink, and DataLink names and display names.

Note

Filter conditions are combined with an AND operator.

Editing and cascading updates

Click the edit button in the target row to modify LogSet properties. When you modify the domain or name of a LogSet, the system automatically updates the reference information for all associated StorageLinks (as src) and DataLinks (as dest).

Frequently asked questions

Why can't I explore the data?

This typically occurs when the Logstore has no configured indexes and no recent log data. Ensure that at least one of the following conditions is met:

  • The LogStore contains logs from within the last 24 hours.

  • An index is configured.

What if a field type is incorrect?

You can manually change the field type in the fields table in Step 2: Configure LogSet. For example, if a field in the logs is a number but is recognized as a string, change its type to integer or float.

Can I associate multiple EntitySets?

Yes. In Step 3: Associate EntitySet, you can select multiple EntitySets to associate. Each association creates a separate DataLink.

If I modify a LogSet field, are existing DataLinks affected?

If you modify a LogSet field that is referenced by fields_mapping, the change does not automatically cascade. You must manually adjust the fields_mapping of the DataLink. In other cases, DataLinks are not affected.