Ad Widget

Collapse

Windows event log item key regex problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • coriben
    Junior Member
    • Dec 2016
    • 1

    #1

    Windows event log item key regex problem

    Hello there,

    I'm having a problem with the event logs item key option. My key looks like this:

    eventlog[System,,"Warning|Error|Failure|Critical",7,,,]

    With this key I want to monitor the bad blocks disk event, which event ID is 7.

    The problem is that this key monitors every event which contains 7 on it's id, like
    7000, 57, and so on. The regex is working in a "contains" fashion rather than an "exact match" one. Is there a way to fix this?

    Thank you!
  • colin88
    Junior Member
    • Dec 2016
    • 13

    #2
    Try using ^7$ instead of just 7. When you use 7, it matches, as you already noticed, everything what contains the 7.
    ^7$ matches only if the 7 stands at the beginning AND at the end of the line.

    Comment

    Working...