logstash-input-cloudflare_logs 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/logstash/inputs/cloudflare_logs.rb +3 -1
- data/logstash-input-cloudflare-logs.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97fb1c091585e0cf444cd4ae0da7857aa89c0ea5
|
4
|
+
data.tar.gz: ecf522d024c3ada5dc7ba31b95fd075307a2a97e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c692e6a1461c80fa4649413e24d9cbf1c54e6b6e5aa5ef5a1a666587f425307e2f393cf433d407e061ea08327eb6993018c1d375fddd0b8861c813d20094f78
|
7
|
+
data.tar.gz: 74639dbf211adb9111fc71588a5042b5e9f7b8c3ee66a8ce0afe178dbfa0e996e618f38362c0fe4f2ba6fddf1e266b88e0d96888ae71b3d895999cb3dcf91504
|
@@ -53,7 +53,6 @@ class CloudflareAccess
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def logs
|
56
|
-
puts("https://api.cloudflare.com/client/v4/zones/#{domain}/logs/received?start=#{start_time}&end=#{end_time}&fields=#{fields.join(',')}")
|
57
56
|
results = RestClient.get("https://api.cloudflare.com/client/v4/zones/#{domain}/logs/received?start=#{start_time}&end=#{end_time}&fields=#{fields.join(',')}", 'X-Auth-Email' => auth_email, 'X-Auth-Key' => auth_key)
|
58
57
|
results.body.split("\n").collect { |raw_log| JSON.parse(raw_log) }
|
59
58
|
end
|
@@ -69,6 +68,7 @@ class LogStash::Inputs::CloudflareLogs < LogStash::Inputs::Base
|
|
69
68
|
config :auth_key, validates: :string, required: true
|
70
69
|
config :domain_key, validates: :string, required: true
|
71
70
|
config :metadata_file, validates: :string, default: '/etc/logstash/cf_metadata.json'
|
71
|
+
config :environment_name, validates: :string
|
72
72
|
|
73
73
|
config :interval, validate: :number, default: 600
|
74
74
|
|
@@ -86,6 +86,8 @@ class LogStash::Inputs::CloudflareLogs < LogStash::Inputs::Base
|
|
86
86
|
def process_logs(queue)
|
87
87
|
cloudflare_access.logs.each do |log|
|
88
88
|
event = LogStash::Event.new(log)
|
89
|
+
log['fields.type'] = 'cloudflare'
|
90
|
+
log['fields.env'] = @environment_name
|
89
91
|
decorate(event)
|
90
92
|
queue << event
|
91
93
|
end
|