logstash-output-azure_loganalytics 0.3.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +23 -0
- data/README.md +1 -3
- data/VERSION +1 -1
- data/lib/logstash/outputs/azure_loganalytics.rb +14 -13
- data/logstash-output-azure_loganalytics.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5a4524f2d0aaed4ee9c1436606f9e2ad3c8d904
|
4
|
+
data.tar.gz: fa42aaced172f03f08182e36dbf518d61bce44f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9662329d14d3d0c968cffb17de307545bd2a95e2e4247383759f094437c148a53cc39705dffa0ea11f631e73c0da1fdceb10928a82509939fcf46f2e418fe203
|
7
|
+
data.tar.gz: 50259e8e408a4398e931304d60f4c65b2d1f129f7f01c5ebc401449c06d3ffb52517ad61a91170775b9a6355b47b861890cf365eaee05bf7cc2af655668a5548
|
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,34 @@
|
|
1
|
+
## 0.5.1
|
2
|
+
|
3
|
+
* Change base [azure-loganalytics-datacollector-api](https://github.com/yokawasa/azure-log-analytics-data-collector) to ">= 0.5.0"
|
4
|
+
|
5
|
+
## 0.5.0
|
6
|
+
|
7
|
+
* Support sprintf syntax like `%{my_log_type}` for `log_type` config param - [Issue #13](https://github.com/yokawasa/logstash-output-azure_loganalytics/issues/13)
|
8
|
+
|
9
|
+
## 0.4.0
|
10
|
+
|
11
|
+
* Change base [azure-loganalytics-datacollector-api](https://github.com/yokawasa/azure-log-analytics-data-collector) to ">= 0.4.0"
|
12
|
+
|
13
|
+
## 0.3.2
|
14
|
+
|
15
|
+
* Improvement: removed unnecessary key check
|
16
|
+
|
17
|
+
## 0.3.1
|
18
|
+
|
19
|
+
* Performance optimization for large key_names list scenario - [Issue#10](https://github.com/yokawasa/logstash-output-azure_loganalytics/issues/10)
|
20
|
+
|
1
21
|
## 0.3.0
|
22
|
+
|
2
23
|
* Support `key_types` param - [Issue#8](https://github.com/yokawasa/logstash-output-azure_loganalytics/issues/8)
|
3
24
|
* Support custom log analytics API endpoint (for supporting Azure sovereign cloud) - [Issue#9](https://github.com/yokawasa/logstash-output-azure_loganalytics/issues/9)
|
4
25
|
|
5
26
|
## 0.2.3
|
27
|
+
|
6
28
|
* Added additional debug logging for successful requests - [PR#7](https://github.com/yokawasa/logstash-output-azure_loganalytics/pull/7) by [@daniel-chambers](https://github.com/daniel-chambers)
|
7
29
|
|
8
30
|
## 0.2.2
|
31
|
+
|
9
32
|
* Fix logging failure - [PR#6](https://github.com/yokawasa/logstash-output-azure_loganalytics/pull/6) by [@daniel-chambers](https://github.com/daniel-chambers)
|
10
33
|
|
11
34
|
## 0.2.1
|
data/README.md
CHANGED
@@ -29,7 +29,7 @@ output {
|
|
29
29
|
|
30
30
|
* **customer\_id (required)** - Your Operations Management Suite workspace ID
|
31
31
|
* **shared\_key (required)** - The primary or the secondary Connected Sources client authentication key.
|
32
|
-
* **log\_type (required)** - The name of the event type that is being submitted to Log Analytics.
|
32
|
+
* **log\_type (required)** - The name of the event type that is being submitted to Log Analytics. It must only contain alpha numeric and _, and not exceed 100 chars. sprintf syntax like `%{my_log_type}` is supported.
|
33
33
|
* **time\_generated\_field (optional)** - Default:''(empty string) The name of the time generated field. Be carefule that the value of field should strictly follow the ISO 8601 format (YYYY-MM-DDThh:mm:ssZ). See also [this](https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-data-collector-api#create-a-request) for more details
|
34
34
|
* **key\_names (optional)** - Default:[] (empty array). The list of key names in in-coming record that you want to submit to Log Analytics.
|
35
35
|
* **key\_types (optional)** - Default:{} (empty hash). The list of data types for each column as which you want to store in Log Analytics (`string`, `boolean`, or `double`)
|
@@ -43,8 +43,6 @@ output {
|
|
43
43
|
> [NOTE] There is a special param for changing the Log Analytics API endpoint (mainly for supporting Azure sovereign cloud)
|
44
44
|
> * **endpoint (optional)** - Default: ods.opinsights.azure.com
|
45
45
|
|
46
|
-
Support custom log analytics API endpoint (for supporting Azure sovereign cloud)
|
47
|
-
|
48
46
|
## Tests
|
49
47
|
|
50
48
|
Here is an example configuration where Logstash's event source and destination are configured as Apache2 access log and Azure Log Analytics respectively.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.5.1
|
@@ -16,7 +16,8 @@ class LogStash::Outputs::AzureLogAnalytics < LogStash::Outputs::Base
|
|
16
16
|
config :shared_key, :validate => :string, :required => true
|
17
17
|
|
18
18
|
# The name of the event type that is being submitted to Log Analytics.
|
19
|
-
# This must
|
19
|
+
# This must only contain alpha numeric and _, and not exceed 100 chars.
|
20
|
+
# sprintf syntax like %{my_log_type} is supported.
|
20
21
|
config :log_type, :validate => :string, :required => true
|
21
22
|
|
22
23
|
# The service endpoint (Default: ods.opinsights.azure.com)
|
@@ -50,10 +51,9 @@ class LogStash::Outputs::AzureLogAnalytics < LogStash::Outputs::Base
|
|
50
51
|
def register
|
51
52
|
require 'azure/loganalytics/datacollectorapi/client'
|
52
53
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
end
|
54
|
+
#if not @log_type.match(/^[[:alpha:]]+$/)
|
55
|
+
# raise ArgumentError, 'log_type must be only alpha characters'
|
56
|
+
#end
|
57
57
|
|
58
58
|
@key_types.each { |k, v|
|
59
59
|
t = v.downcase
|
@@ -75,6 +75,7 @@ class LogStash::Outputs::AzureLogAnalytics < LogStash::Outputs::Base
|
|
75
75
|
|
76
76
|
public
|
77
77
|
def receive(event)
|
78
|
+
@log_type = event.sprintf(@log_type)
|
78
79
|
# Simply save an event for later delivery
|
79
80
|
buffer_receive(event)
|
80
81
|
end # def receive
|
@@ -88,13 +89,13 @@ class LogStash::Outputs::AzureLogAnalytics < LogStash::Outputs::Base
|
|
88
89
|
document = {}
|
89
90
|
event_hash = event.to_hash()
|
90
91
|
if @key_names.length > 0
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
92
|
+
# Get the intersection of key_names and keys of event_hash
|
93
|
+
keys_intersection = @key_names & event_hash.keys
|
94
|
+
keys_intersection.each do |key|
|
95
|
+
if @key_types.include?(key)
|
96
|
+
document[key] = convert_value(@key_types[key], event_hash[key])
|
97
|
+
else
|
98
|
+
document[key] = event_hash[key]
|
98
99
|
end
|
99
100
|
end
|
100
101
|
else
|
@@ -139,4 +140,4 @@ class LogStash::Outputs::AzureLogAnalytics < LogStash::Outputs::Base
|
|
139
140
|
end
|
140
141
|
end
|
141
142
|
|
142
|
-
end # class LogStash::Outputs::AzureLogAnalytics
|
143
|
+
end # class LogStash::Outputs::AzureLogAnalytics
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
|
20
20
|
# Gem dependencies
|
21
21
|
s.add_runtime_dependency "rest-client", ">= 1.8.0"
|
22
|
-
s.add_runtime_dependency "azure-loganalytics-datacollector-api", ">= 0.
|
22
|
+
s.add_runtime_dependency "azure-loganalytics-datacollector-api", ">= 0.5.0"
|
23
23
|
s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99"
|
24
24
|
s.add_runtime_dependency "logstash-codec-plain"
|
25
25
|
s.add_development_dependency "logstash-devutils"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-output-azure_loganalytics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yoichi Kawasaki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
requirements:
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 0.
|
32
|
+
version: 0.5.0
|
33
33
|
name: azure-loganalytics-datacollector-api
|
34
34
|
prerelease: false
|
35
35
|
type: :runtime
|
@@ -37,7 +37,7 @@ dependencies:
|
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.5.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|