Choose data features

Updated at:

Select appropriate fields from a Logstore or MetricStore to configure data features for Intelligent Anomaly Analysis.

When you configure data features, specify whether your data is metricized or non-metricized. The configuration varies by data type.

  • For metricized data, the model uses a consumer group to extract metrics for Intelligent Anomaly Analysis.

  • For non-metricized data, the model uses your custom query and analytic statement to extract metrics for Intelligent Anomaly Analysis.

Log samples

Logs used for Intelligent Anomaly Analysis typically have one of the following formats:

  • Log A

    __time__: 1631794322
    service_name: front-end
    host_name: front-end-davadf-0
    process_pid: 9
    cpu_util: 0.8
    mem_util: 34
    avg_load: 10.534
    disk_util: 0.112
  • Log B

    __time__: 1631794322
    service_name: front-end
    host_name: front-end-davadf-0
    process_pid: 9
    metric_name: cpu_util
    value: 0.8

Configuration example 1

Use a consumer group to extract metrics from metricized data for Intelligent Anomaly Analysis.

  • Log A

    • Set the time field to __time__.

    • Set the entity field to service_name, host_name, and process_pid.

      Note

      An entity might have multiple process_pid values at a given time. Therefore, service_name and host_name alone cannot uniquely identify an entity. If you set the entity field to only service_name and host_name, the model cannot recognize the data features.

    • Set the feature field to cpu_util, mem_util, avg_load, and disk_util.

  • Log B

    • Set the time field to __time__.

    • Set the entity field to service_name, host_name, process_pid, and metric_name.

      Note

      An entity might have multiple process_pid and metric_name values at a given time. Therefore, service_name and host_name alone cannot uniquely identify an entity. If you set the entity field to only service_name and host_name, the model cannot recognize the data features.

    • Set the feature field to value.

Configuration example 2

Use a custom query and analytic statement to extract metrics from non-metricized data for Intelligent Anomaly Analysis.

Note

After data is aggregated with a SQL query, the specified entity fields can uniquely identify an entity.

  • Log A

    • Set the query and analytic statement to * | select __time__-__time__%60 as __time__, avg(cpu_util) as cpu_util, avg(mem_util) as mem_util, service_name, host_name from log group by __time__, service_name, host_name limit 1000.

    • Set the time field to __time__.

    • Set the entity field to service_name and host_name.

    • Set the feature field to cpu_util and mem_util.

  • Log B

    • Set the query and analytic statement to * | select __time__-__time__%60 as __time__, avg(if(metric_name = 'cpu_util', value, 0)) as value, service_name, host_name from log group by __time__, service_name, host_name limit 1000.

    • Set the time field to __time__.

    • Set the entity field to service_name and host_name.

    • Set the feature field to value.