winevt_c 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3232bf062fb10d6e5e383bfe921d151bed37485d9d84395b7ead76f99e95f988
4
- data.tar.gz: 55f909f1c520aabe3eabe5ee43aebf8ec4aa7630035ea81e0accccec658c84a5
3
+ metadata.gz: 00ad0bd482eaac0eda25838c5a183d40a57cf99da30221e9c3eaaeb6a7b6f2f7
4
+ data.tar.gz: 1ff2674b2503c078501740d851765b07a8010cd20e6dcc4e18560424266b860d
5
5
  SHA512:
6
- metadata.gz: 9e6908fd3207d4906a322ce29263c03b92ee53155f96a95c0327fd31d671f518164d270808aa09bc10bb5f64fb18b48e397033f340628c5b64aea567c03a307a
7
- data.tar.gz: d45d945e85af3bfdac26e57c3d16bea8c033c950ac3eef2af830be67ad45cbe4bf5d98719dbec8f76961b20b210c175f511f0f5f364c93a00dc49c084b401f5f
6
+ metadata.gz: e14a6ea1584be82c9e111f83387838043f54be435e6509cd36b8162c76b5ee2ab951b4b25676239462628edb167521980b00da480fb4b304cfa1da051abb347a
7
+ data.tar.gz: ce59efd377aec40a5b63fb56e7fe36673b58b73aa54bc887f798c45eb2aadce3ee744b4c934110ee9f31a516621746f9f3f22868681d173067a7f4fb253837b1
data/example/eventlog.rb CHANGED
@@ -3,14 +3,6 @@ require 'rexml/document'
3
3
 
4
4
  @query = Winevt::EventLog::Query.new("Application", "*[System[(Level <= 3) and TimeCreated[timediff(@SystemTime) <= 86400000]]]")
5
5
 
6
- @query.each do |eventlog, message|
7
- doc = REXML::Document.new(eventlog)
8
- nodes = []
9
- REXML::XPath.each(doc, "/Event/EventData/Data") do |node|
10
- nodes << node.text
11
- end
12
- message = message.gsub(/(%\d+)/, '\1$s')
13
- message = sprintf(message, *nodes)
14
-
6
+ @query.each do |eventlog, message, string_inserts|
15
7
  puts ({eventlog: eventlog, data: message})
16
8
  end
data/example/tailing.rb CHANGED
@@ -8,13 +8,9 @@ while (1) do
8
8
  if @subscribe.next
9
9
  eventlog = @subscribe.render
10
10
  message = @subscribe.message
11
- doc = REXML::Document.new(eventlog)
12
- nodes = []
13
- REXML::XPath.each(doc, "/Event/EventData/Data") do |node|
14
- nodes << node.text
15
- end
11
+ string_inserts = @subscribe.string_inserts
16
12
  message = message.gsub(/(%\d+)/, '\1$s')
17
- message = sprintf(message, *nodes)
13
+ message = sprintf(message, *string_inserts)
18
14
 
19
15
  puts ({eventlog: eventlog, data: message})
20
16
  else
@@ -1,3 +1,3 @@
1
1
  module Winevt
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: winevt_c
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroshi Hatake