Forum Discussion

cpatel87's avatar
cpatel87
Copper Contributor
Nov 16, 2020

No data for the given query On Azure Dashboard

Hi,

 

When I run my query on Log Analytics it shows proper result but on dashboard it shows No data for the given query On Azure Dashboard

 

My query contain Ago. 

 

my Query sample :

 

union (traces)
| where timestamp > ago(8d) and timestamp < ago(7d)
| extend itemType = iif(itemType == 'availabilityResult',itemType,iif(itemType == 'customEvent',itemType,iif(itemType == 'dependency',itemType,iif(itemType == 'pageView',itemType,iif(itemType == 'request',itemType,iif(itemType == 'trace',itemType,iif(itemType == 'exception',itemType,"")))))))
| where ((itemType == 'trace' or (itemType == 'request' or (itemType == 'pageView' or (itemType == 'customEvent' or (itemType == 'exception' or (itemType == 'dependency' or itemType == 'availabilityResult')))))))
| where message startswith 'Single_search_result_common-RCOM'
| project timestamp, message = case(message startswith 'Single_search_result_common-RCOM-true', 'R.com AVL', message startswith 'Single_search_result_common-RCOM-false', 'R.com NO AVL', 'unknown')
| summarize count() by message , bin(timestamp,1h)
| render timechart
 
Please help me to how to use Ago or such function on azure dashboard chart.
 
  • cpatel87 

    This was probably a question for the Azure Monitor forum, but in case you don't have an answer, Dashboards default to 24hrs, so you have to change the date on the dashboard to be > 8days so your query can find the data.
    I didn't see the need for a Union (based on the query supplied) or the complex itemType, so I have simplified the query - ignore if this isn't required.   Thanks  

    traces
    //
    | where timestamp between(ago(8d) .. ago(7d))
    | extend itemType = iif(itemType == 'availabilityResult',itemType,iif(itemType == 'customEvent',itemType,iif(itemType == 'dependency',itemType,iif(itemType == 'pageView',itemType,iif(itemType == 'request',itemType,iif(itemType == 'trace',itemType,iif(itemType == 'exception',itemType,"")))))))
    //
    | where itemType in ( 'trace' ,'request','pageView','customEvent' ,'exception' ,'dependency' ,'availabilityResult')
    //
    | where message startswith 'Single_search_result_common-RCOM'
    | project timestamp, message = case(message startswith 'Single_search_result_common-RCOM-true', 'R.com AVL', message startswith 'Single_search_result_common-RCOM-false', 'R.com NO AVL', 'unknown')
    | summarize count() by message , bin(timestamp,1h)
    | render timechart

     

Resources