Querying on TimeGenerated

%3CLINGO-SUB%20id%3D%22lingo-sub-3256729%22%20slang%3D%22en-US%22%3EQuerying%20on%20TimeGenerated%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3256729%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20running%20two%20searches.%26nbsp%3B%20One%20uses%20the%20dropdown%20time%20selector%20(30m)%20and%20the%20other%20search%20is%20using%20TimeGenerated%20%26gt%3B%3D%20ago(30m).%26nbsp%3B%20The%20search%20returns%20the%20same%20number%20of%20logs%20but%20it%20displays%20the%20fields%20differently.%26nbsp%3B%20In%20the%20first%20search%20using%20dropdown%20selector%20it%20fills%20out%20the%20fields%20as%20expected%20but%20with%20the%20TimeGenerated%20search%20many%20of%20the%20fields%20are%20blank.%26nbsp%3B%20Think%20I'm%20not%20fully%20understanding%20how%20the%20TimeGenerated%20filter%20is%20working.%26nbsp%3B%20Any%20sites%20for%20a%20better%20understanding%3F%26nbsp%3B%20Or%20why%20the%20results%2Ffields%20would%20be%20blank%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJoe%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3256729%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EKusto%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ELog%20Data%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3257580%22%20slang%3D%22en-US%22%3ERe%3A%20Querying%20on%20TimeGenerated%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3257580%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20never%20seen%20a%20case%20where%20the%20result%20differs%20either.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20don't%20suppose%20the%20log%20entries%20are%20sorted%20differently%3F%3CBR%20%2F%3ESome%20tables%20such%20as%20AzureDiagnostics%20contain%20different%20logs%20from%20different%20sources%2C%20and%20these%20different%20types%20of%20logs%20have%20different%20columns.%20Column%20A%20that%20is%20only%20used%20by%20log%20type%20A%2C%20could%20show%20as%20empty%20in%20a%20log%20entry%20from%20log%20type%20B%2C%20and%20vice%20versa.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3256964%22%20slang%3D%22en-US%22%3ERe%3A%20Querying%20on%20TimeGenerated%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3256964%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1080673%22%20target%3D%22_blank%22%3E%40j0ebeer%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHave%20you%20tried%20the%20same%20in%20the%20demo%20logs%3F%26nbsp%3B%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fportal.azure.com%23%404bd2cd73-7c32-48aa-8a02-646c8bc0d343%2Fblade%2FMicrosoft_Azure_Monitoring_Logs%2FDemoLogsBlade%2FresourceId%2F%252FDemo%2Fsource%2FLogsBlade.AnalyticsShareLinkToQuery%2Fq%2FH4sIAAAAAAAAA%25252FNITSwqSUpNLOGqUSjPSC1KVQjJzE11T81LLUosSU1RsLNVSEzP1zA2yNUEAFl%25252F1CsrAAAA%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EGo%20to%20Log%20Analytics%20and%20run%20query%26nbsp%3B%26nbsp%3B%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20it%20the%20rows%20or%20columns%20that%20are%20blank%3F%3CBR%20%2F%3E%3CBR%20%2F%3EUsing%20a%20data%20source%20that%20only%20changes%20hourly%2C%20the%20rows%20all%20look%20fine%20to%20me%2C%20I%20used%20this%20query%2C%20then%20a%20query%20in%20a%20new%20tab%20without%20the%20%3CSTRONG%3Ewhere%20TimeGenerated%3C%2FSTRONG%3E%20and%20setting%204hrs%20in%20the%20drop%20down.%26nbsp%3B%20Both%20had%20166%20rows%20with%20all%20columns%20identical.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-cpp%22%3E%3CCODE%3EUsage%0A%7C%20where%20TimeGenerated%20%26gt%3B%20ago(4h)%0A%7C%20order%20by%20TimeGenerated%20desc%2C%20DataType%20asc%20%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

I'm running two searches.  One uses the dropdown time selector (30m) and the other search is using TimeGenerated >= ago(30m).  The search returns the same number of logs but it displays the fields differently.  In the first search using dropdown selector it fills out the fields as expected but with the TimeGenerated search many of the fields are blank.  Think I'm not fully understanding how the TimeGenerated filter is working.  Any sites for a better understanding?  Or why the results/fields would be blank?

 

Joe

2 Replies

@j0ebeer 

 

Have you tried the same in the demo logs?  Go to Log Analytics and run query  

 

Is it the rows or columns that are blank?

Using a data source that only changes hourly, the rows all look fine to me, I used this query, then a query in a new tab without the where TimeGenerated and setting 4hrs in the drop down.  Both had 166 rows with all columns identical.

 

Usage
| where TimeGenerated > ago(4h)
| order by TimeGenerated desc, DataType asc 

 

I have never seen a case where the result differs either.

I don't suppose the log entries are sorted differently?
Some tables such as AzureDiagnostics contain different logs from different sources, and these different types of logs have different columns. Column A that is only used by log type A, could show as empty in a log entry from log type B, and vice versa.