根据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