Event Log Monitor

Posted on 2009-04-13
Last Modified: 2013-12-17
VERY NEW to C# (coding in general)

I want to write an app (console or preferably a service) that will watch the event log for specific words in a Description, and react based upon that error.   For instance:

An event log is written to the Application Log with the word "Fiddler" in the description.  The app will then look back 5 minutes for any other events that may have been recorded (meeting the same criteria) plus look for an event that indicates that a specific service has been recycled....if true, do nothing.  If there are events and the service has not been recycled then recycle the service in question.

The last part just prevents a loop from occurring.  the events will happed when the service is recycled...that is the reasoning behind looking back 5 minutes.
Question by:crokeefe28
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

ppittle earned 500 total points
ID: 24132192

Take a look at this code example:


Author Comment

ID: 24132621
The example is VB.NET....I need C#.  Plus that only writes one new event to the console.
LVL 51

Expert Comment

by:Steve Bink
ID: 24144235
>>> The example is VB.NET....I need C#.  Plus that only writes one new event to the console.

I disagree.  The sample looks like C to me.  It's using C syntax ("string log;" instead of "Dim log as String"), and even has the label C# everywhere on the page.  In fact, the only reference I see to VB.NET at all is in the drop-down box at the top of the page to go to another section.

As far as writing one event to console, that's the example.  Look at it, understand it, then expand it according to your own needs.
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

LVL 96

Expert Comment

by:Bob Learned
ID: 24148691
That web page lets you switch between languages like VB.NET, C#, and C++.

Author Comment

ID: 24153945
I did not see the area on the left to switch between VB and C#.  I will read a little further, but I was hoping to get a better understanding of the requirements to make it happen (being so new to this).
LVL 51

Expert Comment

by:Steve Bink
ID: 24154058
>>> That web page lets you switch between languages like VB.NET, C#, and C++.

LOL!  I get it now...  :)

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
An overview on how to enroll an hourly employee into the employee database and how to give them access into the clock in terminal.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question