以下是 kusto 查询:
ADFActivityRun
| where PipelineName contains "MyPipeline"
| where OperationName == "Failed"
| order by TimeGenerated desc
| take 1
输出列给出以下结果:
"{
""name"": ""varFileNames"",
""value"": [
{
""name"": ""Z400_EEE_20191110_ERR.txt"",
""type"": ""File""
},
{
""name"": ""Z400_CCC_20191119_ERR.txt"",
""type"": ""File""
},
{
""name"": ""Z400_DDD_20191121_ERR.txt"",
""type"": ""File""
},
{
""name"": ""Z400_EEE_20191122_ERR.txt"",
""type"": ""File""
},
{
""name"": ""Z400_AAA_20191202_ERR.txt"",
""type"": ""File""
}
]
}"
文件名中包含 yyyymmdd。我只想获取最新的文本文件名。在上述情况下 - Z400_AAA_20191202_ERR.txt
意图是发送警报 - “上述错误文件可用,请检查此文件”