logstash-output-splunk_hec 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/logstash/outputs/splunk_hec.rb +8 -5
- data/logstash-output-splunk_hec.gemspec +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: c8c44287f9aa9bd45833d5cce538e60db131970141b39c951f64ccffe42e9bc3
|
4
|
+
data.tar.gz: 240a8fb2b2abaa8f60aedd60e158531f21419d90cbc4f4d966096c7fe9eb82e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d35c322a512d12e456948eabdbc827dbdb324f6c42ac0114135ce2764f26795f6107f2a6540a82419a2a607ce3aa09585a48cf10e851ab7fd6dd412a3b9271d4
|
7
|
+
data.tar.gz: e891f646147845fa33c5d872fe775afded22a49b41009785eebeb7ea18e0afc75f86cd7c8344dff7ad96cbc9bf651852ca3da369041682ef041136f6ca3d6997
|
@@ -51,14 +51,15 @@ class LogStash::Outputs::SplunkHec < LogStash::Outputs::Base
|
|
51
51
|
event_data.delete("@version")
|
52
52
|
|
53
53
|
hec_event = {
|
54
|
-
"time" => event.get("@timestamp").to_i,
|
55
|
-
"host" => event.get("host
|
56
|
-
"source" => event.get("source")
|
54
|
+
"time" => (event.get("@timestamp").to_f * 1000).to_i,
|
55
|
+
"host" => event.get("[host][name]") || Socket.gethostname,
|
56
|
+
"source" => event.get("source") || "logstash",
|
57
57
|
"sourcetype" => @sourcetype,
|
58
|
-
"index" => @index
|
59
|
-
"event" => event_data
|
58
|
+
"index" => @index
|
60
59
|
}
|
61
60
|
|
61
|
+
hec_event.merge!(event_data)
|
62
|
+
|
62
63
|
@event_batch << hec_event
|
63
64
|
end
|
64
65
|
|
@@ -82,6 +83,8 @@ class LogStash::Outputs::SplunkHec < LogStash::Outputs::Base
|
|
82
83
|
request["Content-Type"] = "application/json"
|
83
84
|
request.body = batch_to_send.map(&:to_json).join("\n")
|
84
85
|
|
86
|
+
@logger.warn("Request body to be sent to Splunk:", :request_body => request.body)
|
87
|
+
|
85
88
|
@retry_count.times do |attempt|
|
86
89
|
begin
|
87
90
|
response = @http.request(request)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-output-splunk_hec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elisha Mawson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logstash-core-plugin-api
|