awsutils 2.1.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/awsutils/awslogs.rb +10 -1
- data/lib/awsutils/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b349fef53bb0e69ba94c897c44395410dba6710
|
4
|
+
data.tar.gz: e1e33dfd6b6c52810309e0b33304268495521ec2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef0b74c2dbbc588ff444ce4f2993cacc71fbb436889bd0f1cc0a82be835e8db2aeba32eac11d5bf6500811cccfc8e1094efc29e1f6e489a325a429725d83282f
|
7
|
+
data.tar.gz: ee242a063408d1712c690fa1d8329c55f692789da9d737945213fd891652e35d8f258c5f3710973304d16a6d60c884af65f96eea08c52919ef5bbb6143381b3d
|
data/lib/awsutils/awslogs.rb
CHANGED
@@ -28,6 +28,10 @@ module AwsUtils
|
|
28
28
|
'Show the request ID in every log message',
|
29
29
|
short: 'r',
|
30
30
|
default: false
|
31
|
+
opt :request_id,
|
32
|
+
'Print only messages with a specific request ID',
|
33
|
+
short: 'R',
|
34
|
+
type: :string
|
31
35
|
opt :log_level,
|
32
36
|
'Lowest log level to show',
|
33
37
|
default: 'INFO',
|
@@ -61,8 +65,13 @@ module AwsUtils
|
|
61
65
|
collector.sort_by(&:timestamp)
|
62
66
|
end
|
63
67
|
|
68
|
+
def filtered_log_events
|
69
|
+
return log_events unless opts[:request_id]
|
70
|
+
log_events.select { |event| event.message =~ /\b#{opts[:request_id]}\b/ }
|
71
|
+
end
|
72
|
+
|
64
73
|
def print_events
|
65
|
-
|
74
|
+
filtered_log_events.each do |ev|
|
66
75
|
if ev.message !~ /^\[(INFO|DEBUG|WARNING|ERROR|NOTICE)\]/ # Check if the message is in the standard format
|
67
76
|
print "#{ev.log_stream_name}: " if opts[:show_stream_name]
|
68
77
|
print Time.at(ev.timestamp / 1e3).iso8601(3) + ' ' if opts[:timestamp]
|
data/lib/awsutils/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awsutils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Herot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|