Windows Event logs

129 views
Skip to first unread message

Karan Modi

unread,
Mar 9, 2021, 12:21:46 PM3/9/21
to golang-nuts
Hello,
       can anyone help please help me with fetching windows Event logs in golang or maybe 
you can refer something. 

It would really help full

Thanks in advance 

jake...@gmail.com

unread,
Mar 10, 2021, 11:26:52 AM3/10/21
to golang-nuts
I can't help directly, but since no one else has responded, maybe this will help.

The windows API call OpenEventLogW() would be the first step. Looking on Github for examples of Go code that makes this call (https://github.com/search?p=2&q=OpenEventLogW+language%3AGo&type=Code), you may be able to see how other folks have done it. The package that comes up the most is winlogbeat/sys/eventlogging. I'm not sure if this is the actual main repo, because there are so many forks. The Readme.md does not seem to indicate what the original repo is.

Anyway, you may be able to use that package directly, or mine it for examples.

Hope this helps.

atakanc...@gmail.com

unread,
Mar 11, 2021, 2:34:13 AM3/11/21
to golang-nuts
If you aren't happy with what the current libraries provide and don't want to delve deep into Windows API, you can also use Powershell commands and parse the results.

10 Mart 2021 Çarşamba tarihinde saat 19:26:52 UTC+3 itibarıyla jake...@gmail.com şunları yazdı:
Reply all
Reply to author
Forward
0 new messages