cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Compare two dql query count value

biswajit-roy76
Visitor

I want to compare two logs count value in dql . How can I achieve that?

3 REPLIES 3

MaciejNeumann
Community Team
Community Team

Hello @biswajit-roy76,

Could you provide more context to your question so our DQL experts can investigate your specific use case?

If you have any questions about the Community, you can contact me at maciej.neumann@dynatrace.com

mosharref_hossn
Observer

You can "append" the search result for another log source and count at the end. 

Example: 

fetch logs
| filter dt.system.bucket == "infra_logs"
| append [
    fetch logs
    | filter dt.system.bucket == "app_logs" 
  ] 
| summarize count(), by:{dt.system.bucket}

Tiit_Hallas
Dynatrace Helper
Dynatrace Helper

You could use a countIf aggregation function in DQL summarize command, e.g. : 

fetch logs
| summarize messages=countif(log.source == "/var/log/messages"), syslog=countif(log.source == "/var/log/syslog")
| fieldsAdd syslog_is_larger = syslog > messages

 

I had a life once. Then I bought my first computer ...

Featured Posts