none
event log top 10 RRS feed

  • Question

  • Greeting,

    I had a task to last one server's top ten error in application log (by event id)

    I did try some small part (which is use array to record the eventid then count them).

    But the issue is:

    how can I pre-define the array ( the event log may contain thousands of error which I can not pre-define)

    Thanks

    newbie in powershell

    Friday, July 14, 2017 1:37 PM

Answers

  • Your question is kind of vague.

    Get-WinEvent -Logname Application |
    	Select-Object id, ProviderName | 
    	Group-Object ID | 
    	Select-Object Name, Count


    \_(ツ)_/


    • Edited by jrv Friday, July 14, 2017 1:52 PM
    • Marked as answer by userausera Friday, July 14, 2017 2:14 PM
    Friday, July 14, 2017 1:47 PM
  • sort count -descending | select -first 10


    \_(ツ)_/

    • Marked as answer by userausera Friday, July 14, 2017 3:18 PM
    Friday, July 14, 2017 2:29 PM

All replies

  • Your question is kind of vague.

    Get-WinEvent -Logname Application |
    	Select-Object id, ProviderName | 
    	Group-Object ID | 
    	Select-Object Name, Count


    \_(ツ)_/


    • Edited by jrv Friday, July 14, 2017 1:52 PM
    • Marked as answer by userausera Friday, July 14, 2017 2:14 PM
    Friday, July 14, 2017 1:47 PM
  • THANKS!!!,

    works

    now the question how to get the top 10?

    sort by the "Count" then from the result get the top 10 list? is that works?

    thanks

    newbie in Powershell

    Friday, July 14, 2017 2:14 PM
  • sort count -descending | select -first 10


    \_(ツ)_/

    • Marked as answer by userausera Friday, July 14, 2017 3:18 PM
    Friday, July 14, 2017 2:29 PM
  • it works

    thanks

    newbie in Powershell

    Friday, July 14, 2017 3:18 PM