winevt_c 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/example/eventlog.rb +0 -1
- data/example/tailing.rb +6 -15
- data/ext/winevt/winevt_utils.cpp +1 -1
- data/lib/winevt/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75744148e9ca94521748b06833b718e340adff8024aa2d2c95560561b2f78067
|
4
|
+
data.tar.gz: c9ccac540fa71ee98862084e765d93ef99e82e0da8ffa539bad5fe01ade3206b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3fa73323e1d79dc1336c8d9d0984f9a00e0f683b38e4fcbd9ffc46c101a6e5727bf542210c59171e997c9fea0662b8b1078a9f7b44748c933623b47de5693c2
|
7
|
+
data.tar.gz: 2e32151fa6b178f98c7c6f97e28e5cbcdd83050bb738cade7cf85f23ba6faf6b8dd09c81c8d51a7460428dff57345fd922aab405b4756b2311632badca8abd2a
|
data/example/eventlog.rb
CHANGED
data/example/tailing.rb
CHANGED
@@ -1,22 +1,13 @@
|
|
1
1
|
require 'winevt'
|
2
|
-
require 'rexml/document'
|
3
2
|
|
4
3
|
@subscribe = Winevt::EventLog::Subscribe.new
|
5
4
|
@subscribe.tail = true
|
6
|
-
@subscribe.subscribe(
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
string_inserts = @subscribe.string_inserts
|
12
|
-
message = message.gsub(/(%\d+)/, '\1$s')
|
13
|
-
message = sprintf(message, *string_inserts)
|
14
|
-
|
5
|
+
@subscribe.subscribe(
|
6
|
+
"Security", "*[System[(Level <= 4) and TimeCreated[timediff(@SystemTime) <= 86400000]]]"
|
7
|
+
)
|
8
|
+
while true do
|
9
|
+
@subscribe.each do |eventlog, message, string_inserts|
|
15
10
|
puts ({eventlog: eventlog, data: message})
|
16
|
-
@subscribe.close_handle # Dispose EVT_HANDLE variable which is allocated in EvtNext
|
17
|
-
else
|
18
|
-
printf(".")
|
19
|
-
sleep(1)
|
20
11
|
end
|
12
|
+
sleep(1)
|
21
13
|
end
|
22
|
-
puts @subscribe.bookmark
|
data/ext/winevt/winevt_utils.cpp
CHANGED
@@ -27,7 +27,7 @@ wstr_to_rb_str(UINT cp, const WCHAR *wstr, int clen)
|
|
27
27
|
VALUE vstr;
|
28
28
|
CHAR *ptr;
|
29
29
|
int len = WideCharToMultiByte(cp, 0, wstr, clen, nullptr, 0, nullptr, nullptr);
|
30
|
-
ptr =
|
30
|
+
ptr = ALLOCV_N(CHAR, vstr, len);
|
31
31
|
WideCharToMultiByte(cp, 0, wstr, clen, ptr, len, nullptr, nullptr);
|
32
32
|
VALUE str = rb_utf8_str_new_cstr(ptr);
|
33
33
|
ALLOCV_END(vstr);
|
data/lib/winevt/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: winevt_c
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hiroshi Hatake
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|