{"blog_url":"https://dharry.hatenablog.com/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fdharry.hatenablog.com%2Fentry%2F20080922%2F1222031566\" title=\" win32-eventlog - harry\u2019s memorandum\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","image_url":null,"author_url":"https://blog.hatena.ne.jp/dharry/","width":"100%","published":"2008-09-22 06:12:46","blog_title":"harry\u2019s memorandum","url":"https://dharry.hatenablog.com/entry/20080922/1222031566","author_name":"dharry","type":"rich","provider_name":"Hatena Blog","version":"1.0","title":" win32-eventlog","provider_url":"https://hatena.blog","categories":["ruby"],"height":"190","description":"win32utils\u3092\u4f7f\u3046\u3068\u8272\u3005\u3067\u304d\u308b\u3002 \u30a4\u30d9\u30f3\u30c8\u30ed\u30b0\u306e\u53d6\u5f97\u3002\u30a8\u30e9\u30fc\u30ed\u30b0\u306e\u307f\u30d7\u30ea\u30f3\u30c8\u3002 require \"win32/eventlog\" include Win32 handle = EventLog.open() handle.total_records # e.g. 916 handle.oldest_record_number # e.g. 1 # Read through every entry, inspecting each struct in turn handle.read { |log| print \"#{log.event_id} #{log.time_written} #\u2026"}