logstash-output-splunk_hec 0.2.0 → 0.2.1
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 +6 -7
- data/logstash-output-splunk_hec.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '09f53b9c010a8b0a598df047bd79b44358b8960c512897b58d02b6ca046b1b0c'
|
4
|
+
data.tar.gz: b6887b783ed1bfae45cc50850d3a59ccfd07e1a00a492462e1d7e518f9bda250
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77d1fc5fbbef2c3e21367253f9add4451f5c512025d82cb3b21f15d3b2824e76605c301accf6e1eeeacd9fc13328a7770b6fbbbc3f1933af42e70ed69b7c12e6
|
7
|
+
data.tar.gz: c84e0e56254de9d4829d7aeacdf2bcfe7e3b80bdc949a9cabbe3b7fc23ed5fec4c141ea35fb07bc346f58f498b46010f366b883d1f54f5adf7becc26f50223d4
|
@@ -51,15 +51,14 @@ class LogStash::Outputs::SplunkHec < LogStash::Outputs::Base
|
|
51
51
|
event_data.delete("@version")
|
52
52
|
|
53
53
|
hec_event = {
|
54
|
-
"time" =>
|
55
|
-
"host" => event.get("
|
56
|
-
"source" => event.get("source")
|
54
|
+
"time" => event.get("@timestamp").to_i,
|
55
|
+
"host" => event.get("host")&.fetch("name") { Socket.gethostname },
|
56
|
+
"source" => event.get("source") { "logstash" },
|
57
57
|
"sourcetype" => @sourcetype,
|
58
|
-
"index" => @index
|
58
|
+
"index" => @index,
|
59
|
+
"event" => event_data
|
59
60
|
}
|
60
61
|
|
61
|
-
hec_event.merge!(event_data)
|
62
|
-
|
63
62
|
@event_batch << hec_event
|
64
63
|
end
|
65
64
|
|
@@ -83,7 +82,7 @@ class LogStash::Outputs::SplunkHec < LogStash::Outputs::Base
|
|
83
82
|
request["Content-Type"] = "application/json"
|
84
83
|
request.body = batch_to_send.map(&:to_json).join("\n")
|
85
84
|
|
86
|
-
@logger.warn("Request body to be sent to Splunk:
|
85
|
+
@logger.warn("Request body to be sent to Splunk: #{request.body}")
|
87
86
|
|
88
87
|
@retry_count.times do |attempt|
|
89
88
|
begin
|