Query Azure WADLogsTable


 
When you have Azure WADLogTable loaded with tons of records, queries takes longer time to return results by using TimeStamp. 

WADLog Table index by partition key and if I query by partition key I see logs are returning way faster. Partition key is datetime in ticks, you can get datetime in ticks by converting datetime string into ticks. I’m lazy to open VS just to get datetime in ticks and use LINQPad tool for these kind of quick conversions. It’s kind of opening notepad and writing C# statements.




Code to get datetime in Ticks: 

DateTime dt = new DateTime(2013, 08, 29, 0,0,0);

long l = dt.Ticks;

 Console.WriteLine(l); //gives 635133312000000000

 

Once you have datetime string in ticks prefix 0, use that value to query the table & you can start see logs immediately. 

Query to Table –
PartitionKey gt '0635133312000000000'

If you want to see errors in log file use query with level = 2. 

PartitionKey gt '0635134032000000000' and Level eq 2


 

Comments

Popular posts from this blog

Windows Azure Package Build Error: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

Resource ID : 1. The request limit for the database is 180 and has been reached.

How to get Client's Location using IPAddress