Forum Discussion

SebasL's avatar
SebasL
Copper Contributor
Aug 24, 2021
Solved

Getting incremental value from Perf / TCPv4 / Connection Failuers

I would like to run a query based on the performance counter ObjectName == "TCPv4" and CounterName == "Connection Failures"   This counter displays the TCP Failure number but its particularity is t...
  • Anders Bengtsson's avatar
    Aug 26, 2021

    Hi,

     

    You can use the prev command. In this example, we look at free space on the C: volume on a computer named Idala. We compare the previous counter value with the current one. We also do a CASE to write different text strings based on the current free space.

     

    Perf
    | where Computer == "idala"
    | where CounterName == "% Free Space"
    | where InstanceName == "C:"
    | serialize | extend prevValue = prev(CounterValue, 1)
    | extend diffvalue = CounterValue - prevValue
    | extend trend = case(CounterValue < prevValue, "Free Space Reduces",
    CounterValue > prevValue, "Free Space Increases",
    "No difference")
    | project TimeGenerated, InstanceName, CounterValue, prevValue, diffvalue, trend
    | order by TimeGenerated desc

Resources