共用方式為


將時間序列深入解析 Gen1 遷移至 Microsoft Fabric 中的即時智慧

注意

時間序列深入解析服務將於 2024 年 7 月 7 日淘汰。 請考慮儘快將現有的環境移轉至替代解決方案。 如需淘汰和移轉的詳細資訊,請造訪我們的文件

概觀

Eventhouse 是即時智慧中的時間序列資料庫。 其可作為從時間序列深入解析移轉數據的目標。

必要條件

內嵌新數據

使用下列步驟開始將新數據擷取到 Eventhouse:

  1. 使用新的取用者群組設定事件 中樞

  2. 從數據源取用數據,並將其內嵌至 Eventhouse。 請參閱有關如何 從事件中樞內嵌數據的檔。

從時間序列深入解析移轉歷程記錄數據

如果您需要從時間序列深入解析環境匯出數據,您可以使用時間序列深入解析查詢 API,以批次方式下載事件,並以所需的格式串行化事件。 根據您儲存匯出數據的位置,您可以從 Azure 儲存體、本機檔案OneLake 內嵌數據。

移轉參考數據

使用下列步驟來移轉參考資料:

  1. 使用時間序列深入解析總管或參考數據 API 來下載參考數據集。

  2. 取得參考數據集之後,請 將其上傳至 Eventhouse 作為另一個數據表。 藉由上傳參考數據集,您可以在 Eventhouse 環境中存取和使用它。

將時間序列深入解析查詢轉譯為 Kusto 查詢語言

針對查詢,建議在 Eventhouse 中使用 Kusto 查詢語言。

事件

{
  "searchSpan": {
    "from": "2021-11-29T22:09:32.551Z",
    "to": "2021-12-06T22:09:32.551Z"
  },
  "predicate": {
    "predicateString": "([device_id] = 'device_0') AND ([has_error] != null OR [error_code] != null)"
  },
  "top": {
    "sort": [
      {
        "input": {
          "builtInProperty": "$ts"
        },
        "order": "Desc"
      }
    ],
    "count": 100
  }
}
	events
| where _timestamp >= datetime("2021-11-29T22:09:32.551Z") and _timestamp < datetime("2021-12-06T22:09:32.551Z") and deviceid == "device_0" and (not(isnull(haserror)) or not(isempty(errorcode)))
| top 100 by _timestamp desc

彙總

{
    "searchSpan": {
      "from": "2021-12-04T22:30:00Z",
      "to": "2021-12-06T22:30:00Z"
    },
    "predicate": {
      "eq": {
        "left": {
          "property": "DeviceId",
          "type": "string"
        },
        "right": "device_0"
      }
    },
    "aggregates": [
      {
        "dimension": {
          "uniqueValues": {
            "input": {
              "property": "DeviceId",
              "type": "String"
            },
            "take": 1
          }
        },
        "aggregate": {
          "dimension": {
            "dateHistogram": {
              "input": {
                "builtInProperty": "$ts"
              },
              "breaks": {
                "size": "2d"
              }
            }
          },
          "measures": [
            {
              "count": {}
            },
            {
              "sum": {
                "input": {
                  "property": "DataValue",
                  "type": "Double"
                }
              }
            },
            {
              "min": {
                "input": {
                  "property": "DataValue",
                  "type": "Double"
                }
              }
            },
            {
              "max": {
                "input": {
                  "property": "DataValue",
                  "type": "Double"
                }
              }
            }
          ]
        }
      }
    ]
  }

	let _q = events | where _timestamp >= datetime("2021-12-04T22:30:00Z") and _timestamp < datetime("2021-12-06T22:30:00Z") and deviceid == "device_0";
let _dimValues0 = _q | project deviceId | sample-distinct 1 of deviceId;
_q
| where deviceid in (_dimValues0) or isnull(deviceid)
| summarize
    _meas0 = count(),
    _meas1 = iff(isnotnull(any(datavalue)), sum(datavalue), any(datavalue)),
    _meas2 = min(datavalue),
    _meas3 = max(datavalue),
    by _dim0 = deviceid, _dim1 = bin(_timestamp, 2d)
| project
    _dim0,
    _dim1,
    _meas0,
    _meas1,
    _meas2,
    _meas3,
| sort by _dim0 nulls last, _dim1 nulls last