logstash-filter-google_appengine 0.114.0 → 0.115.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -12
- data/lib/logstash/filters/google_appengine.rb +9 -1
- data/logstash-filter-google_appengine.gemspec +1 -1
- data/spec/filters/google_appengine_spec.rb +4 -0
- 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: 215b39c49fa14a4c0a9d64493dfaf9f858d34b47
|
4
|
+
data.tar.gz: 49324f32a208857e16d95ead80ab1fb7d21673ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db3ecb57bb93a0f90a651ec72b5dd17ffad71916c56940ba8cc8ccb5da3f2f5760291dcd09e05c57b2ecf5ad0cc83cf6792905e7567da92d6abdbf3ac59bb597
|
7
|
+
data.tar.gz: d88a4044518e010764182af1a280753056e3d5973446f1ad1ce934eab03f040e93e634f2337ff13f6cf7a8577ed6c3265ad35efff8e7615a39a66b41cfe902cd
|
data/README.md
CHANGED
@@ -71,16 +71,6 @@ gem build logstash-filter-google_appengine.gemspec
|
|
71
71
|
```
|
72
72
|
- Install the plugin from the Logstash home
|
73
73
|
```sh
|
74
|
-
bin/plugin install /your/local/plugin/logstash-filter-
|
74
|
+
bin/plugin install /your/local/plugin/logstash-filter-google_appengine-*.gem
|
75
75
|
```
|
76
|
-
- Start Logstash and proceed to test the plugin
|
77
|
-
|
78
|
-
## Contributing
|
79
|
-
|
80
|
-
All contributions are welcome: ideas, patches, documentation, bug reports, complaints, and even something you drew up on a napkin.
|
81
|
-
|
82
|
-
Programming is not a required skill. Whatever you've seen about open source and maintainers or community members saying "send patches or die" - you will not see that here.
|
83
|
-
|
84
|
-
It is more important to the community that you are able to contribute.
|
85
|
-
|
86
|
-
For more information about contributing, see the [CONTRIBUTING](https://github.com/elastic/logstash/blob/master/CONTRIBUTING.md) file.
|
76
|
+
- Start Logstash and proceed to test the plugin
|
@@ -20,7 +20,11 @@ class LogStash::Filters::GoogleAppengine < LogStash::Filters::Base
|
|
20
20
|
payload = event['protoPayload']
|
21
21
|
payload.delete '@type'
|
22
22
|
payload['type'] = event['type']
|
23
|
+
payload['latencyS'] = to_number(payload['latency'])
|
24
|
+
payload['pendingTimeS'] = to_number(payload['pendingTime'])
|
25
|
+
|
23
26
|
lines = payload.delete 'line'
|
27
|
+
|
24
28
|
if lines
|
25
29
|
lines.each_with_index { |line, i|
|
26
30
|
yield create_event(collect_line_data(i, line, payload))
|
@@ -33,6 +37,10 @@ class LogStash::Filters::GoogleAppengine < LogStash::Filters::Base
|
|
33
37
|
|
34
38
|
private
|
35
39
|
# noinspection RubyStringKeysInHashInspection
|
40
|
+
def to_number(string)
|
41
|
+
string ? string.delete("s").to_f : 0.0
|
42
|
+
end
|
43
|
+
|
36
44
|
def collect_line_data(i, line, payload)
|
37
45
|
{
|
38
46
|
'id' => get_id(payload['requestId'] + i.to_s),
|
@@ -61,7 +69,7 @@ class LogStash::Filters::GoogleAppengine < LogStash::Filters::Base
|
|
61
69
|
|
62
70
|
def get_id(source)
|
63
71
|
@semaphore.synchronize {
|
64
|
-
@md5.hexdigest(source)
|
72
|
+
@md5.hexdigest(source) #md5 isn't threadsafe :(
|
65
73
|
}
|
66
74
|
end
|
67
75
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-filter-google_appengine'
|
4
|
-
s.version = '0.
|
4
|
+
s.version = '0.115.0'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "This filter may be used to decode via inputs appengine logs"
|
7
7
|
s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
|
@@ -16,6 +16,7 @@ describe LogStash::Filters::GoogleAppengine do
|
|
16
16
|
describe "should merge the request payload with the reuest lines data" do
|
17
17
|
test_sample = LogStash::Json::load(File.open("spec/filters/appengine.logs.jsonl", "rb").read)
|
18
18
|
sample (test_sample) do
|
19
|
+
LATENCY_OF_REQUEST = 0.115752
|
19
20
|
insist { subject.length } == 3
|
20
21
|
|
21
22
|
insist { subject[0]["message"] }=="IdentityFilter logUserIdentity: [[meta]] <anonymous:true>\n"
|
@@ -23,12 +24,15 @@ describe LogStash::Filters::GoogleAppengine do
|
|
23
24
|
insist { subject[0]["time"] } == "2015-09-03T10:59:40.589Z"
|
24
25
|
insist { subject[0]["position"] } == 0
|
25
26
|
insist { subject[0]["@type"] } == nil
|
27
|
+
insist { subject[0]["latencyS"] } == LATENCY_OF_REQUEST
|
28
|
+
insist { subject[0]["pendingTimeS"] } == 0.0
|
26
29
|
|
27
30
|
insist { subject[1]["message"] }=="HttpOnlyFilter getSession: add additional Set-Cookie with httpOnly-flag for JSESSIONID\n"
|
28
31
|
insist { subject[1]["id"] } == md5.hexdigest(subject[1]["requestId"] + "1")
|
29
32
|
insist { subject[1]["@type"] } == nil
|
30
33
|
insist { subject[1]["time"] } =="2015-09-03T10:59:40.65Z"
|
31
34
|
insist { subject[1]["position"] } == 1
|
35
|
+
insist { subject[0]["pendingTimeS"] } == 0.0
|
32
36
|
end
|
33
37
|
end
|
34
38
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-filter-google_appengine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.115.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Small Improvements
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logstash-core
|