IngestionTime 策略IngestionTime policy

IngestionTime 策略是可以对表设置(启用)的可选策略。The IngestionTime policy is an optional policy that can be set (enabled) on tables.

启用后,Kusto 会将隐藏的 datetime 列添加到名为 $IngestionTime 的表。When enabled, Kusto adds a hidden datetime column to the table, called $IngestionTime. 现在,每当引入新数据时,引入时间都会记录在此隐藏列中。Now, whenever new data is ingested, the time of ingestion is recorded in the hidden column. 该时间是由 Kusto 群集在数据提交之前测量的。That time is measured by the Kusto cluster just before the data is committed.

备注

每条记录都有其自己的 $IngestionTime 值。Every record has its own $IngestionTime value.

由于引入时间列处于隐藏状态,因此不能直接查询其值,Since the ingestion time column is hidden, you can't directly query for its value. 而只能使用名为 ingestion_time() 的特殊函数来检索该值。Instead, a special function called ingestion_time() retrieves that value. 如果表中没有 datetime 列,或者在引入记录时未启用 IngestionTime 策略,则返回 NULL 值。If there's no datetime column in the table, or the IngestionTime policy wasn't enabled when a record was ingested, a null value is returned.

IngestionTime 策略设计用于两种主要方案:The IngestionTime policy is designed for two main scenarios:

  • 允许用户估算引入数据时的延迟。To allow users to estimate the latency in ingesting data. 包含日志数据的多个表具有时间戳列。Many tables with log data have a timestamp column. 时间戳值由源填充,可指示生成记录的时间。The timestamp value gets filled by the source and indicates the time when the record was produced. 通过将该列的值与引入时间列进行比较,可以估算引入数据的延迟时间。By comparing that column's value with the ingestion time column, you can estimate the latency for getting the data in.

    备注

    计算得出的值只是一个估计值,因为源和 Kusto 不一定进行时钟同步。The calculated value is only an estimate, because the source and Kusto don't necessarily have their clocks synchronized.

  • 为了支持允许用户发出连续查询的数据库游标,查询仅限于自上次查询以来引入的数据。To support Database Cursors that let users issue consecutive queries, the query is limited to the data that was ingested since the previous query.

获取详细信息。For more information. 请参阅用于管理 IngestionTime 策略的控制命令see the control commands for managing the IngestionTime policy.