【问题标题】:Is there a tool to view azure data factory logs?是否有查看 azure 数据工厂日志的工具?
【发布时间】:2023-04-10 21:45:01
【问题描述】:

我在 Azure 数据工厂管道中设置日志记录以进行复制活动。

日志被写入一个 azure blob 容器。 但是,这会生成许多单独的文件夹,每个文件夹都包含一个日志文件。 (此管道每 x 分钟触发一次)

是否有工具可以使这更具可读性? 例如连接日志(保持顺序)

或者还有其他方法可以使用这些日志文件吗?

【问题讨论】:

  • Azure 数据工厂可能会读取这些日志并对其进行转换;)

标签: azure azure-blob-storage azure-data-factory


【解决方案1】:

根据official documentation,您可以使用多个分析引擎进一步分析日志文件。

下面有几个例子使用SQL查询通过将csv日志文件导入SQL数据库来分析日志文件。

1.给我复制的文件列表。

select OperationItem from SessionLogDemo where Message like '%File is successfully copied%'

2。给我在特定时间范围内复制的文件列表。

select OperationItem from SessionLogDemo where TIMESTAMP >= '<start time>' and TIMESTAMP <= '<end time>' and Message like '%File is successfully copied%'

3.给我一个带有复制时间和元数据的特定文件。

select * from SessionLogDemo where OperationItem='<file name>'

4.给我一份文件列表,其中包含在某个时间范围内复制的元数据。

select * from SessionLogDemo where OperationName='FileRead' and Message like 'Start to read%' and OperationItem in (select OperationItem from SessionLogDemo where TIMESTAMP >= '<start time>' and TIMESTAMP <= '<end time>' and Message like '%File is successfully copied%')

5.给我跳过的文件列表。

select OperationItem from SessionLogDemo where OperationName='FileSkip'

6.告诉我跳过特定文件的原因。

select TIMESTAMP, OperationItem, Message from SessionLogDemo where OperationName='FileSkip'

7.给我由于相同原因而跳过的文件列表:“blob 文件不存在”。

select TIMESTAMP, OperationItem, Message from SessionLogDemo where OperationName='FileSkip' and Message like '%UserErrorSourceBlobNotExist%'

8.给我复制时间最长的文件名。

select top 1 OperationItem, CopyDuration=DATEDIFF(SECOND, min(TIMESTAMP), max(TIMESTAMP)) from SessionLogDemo group by OperationItem order by CopyDuration desc

【讨论】:

  • 谢谢!我看到为了使用它,需要将日志导入 sql 数据库。有没有关于如何做到这一点的指导方针?您会使用其他管道吗?
猜你喜欢
  • 2021-12-05
  • 2021-09-18
  • 2021-01-18
  • 1970-01-01
  • 2022-10-04
  • 2020-07-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多