【发布时间】:2016-10-29 09:20:41
【问题描述】:
Azure 诊断正在将 Windows 事件推送到存储表“WADWindowsEventLogsTable”中。
我想使用 VisualStudio(2015) 和 CloudExplorer 查询这个存储表。
由于这张表的内容很大,我无限期地等待结果..
这是一个查询示例:
EventId eq 4096 and Timestamp gt datetime'2016-06-24T08:20:00' and Timestamp lt datetime'2016-06-24T10:00:00'
我想这个查询是正确的?
是否存在提高性能的方法?
- 过滤结果列?
- 只返回前 X 个结果?
- 其他有用的提示?
我知道更好的方法是编写脚本;例如使用 Python,但我想尽可能多地使用 UI..
(编辑)跟随 Gaurav Mantri 回答我使用这个小 C# 程序来构建我的查询。答案很快,解决了我最初的性能问题:
static void Main(string[] args)
{
string startDate = "24 June 2016 8:20:00 AM";
string endDate = "24 June 2016 10:00:00 AM";
string startPKey = convertDateToPKey(startDate);
string endPKey = convertDateToPKey(endDate);
Debug.WriteLine("(PartitionKey gt '" + startPKey + "'"
+ " and PartitionKey le '" + endPKey +"')"
+ " and (EventId eq 4096)"
);
}
private static string convertDateToPKey(string myDate)
{
System.DateTime dt = System.Convert.ToDateTime(myDate);
long dt2ticks = dt.Ticks;
string ticks = System.Convert.ToString(dt2ticks);
return "0" + ticks;
}
【问题讨论】:
标签: wcf azure visual-studio-2015 azure-table-storage