logstash-output-lmlogs 1.0.0 → 1.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7a6870b79a3aa4828273152c3955c0bd9ab4268336497c5f2a149b3194775842
4
- data.tar.gz: 20a754e8964d1ddb7ee0e6f272b6a72035603071aef7e13863713ab0acc936d3
3
+ metadata.gz: d6d83c13647807e66508b976a76aa5481dc4412c8631d0184f2a4cd793384a3e
4
+ data.tar.gz: b2d5a69f85702525e83095cc9cab180ab194402873fe18317e597cf2f591331d
5
5
  SHA512:
6
- metadata.gz: de15b190857a5c4343189c4e3cac70fda17b44672140dc31afd19b77ce6298ac205685957e922c0c687fc4cf913be3d11c93be6706d795be83362f1c801d840f
7
- data.tar.gz: 6b972a9c27bd57f27e2503ba32fdca11afe36b72a45e3395d5e2a68b6efaca72fe557bc23e5900bb1a1e92196adb3a28ddb67a55f0db6e471df1d81773fb0a9a
6
+ metadata.gz: e7f30119cf9877d14b7362eb3c0fe6dbec7ed8fb95de34596ff1311ced6fc511286f982680ad3d50c632640fc4d7ec2e53d54548fd3081155872d63eb1d25936
7
+ data.tar.gz: 693702b1e37126660b117de0b34a8758579bf6fa20e26479b55b7e2022090d64497041c7ddb9563d169297f41aa82ce142d6b7e13a97558defdc0d9e8f3300c4
data/CHANGELOG.md CHANGED
@@ -1,2 +1,2 @@
1
- ## 0.1.0
1
+ ## 1.0.0
2
2
  - First version of the plugin
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Build Status](https://travis-ci.org/unomaly/logstash-output-unomaly.svg?branch=master)](https://travis-ci.org/unomaly/logstash-output-unomaly)
1
+ [![Gem Version](https://badge.fury.io/rb/logstash-output-lmlogs.svg)](https://badge.fury.io/rb/logstash-output-lmlogs)
2
2
 
3
3
  This plugin sends Logstash events to the [Logicmonitor Logs](https://www.logicmonitor.com)
4
4
 
@@ -21,19 +21,18 @@ output {
21
21
  }
22
22
  ```
23
23
 
24
- ```
25
24
 
26
25
 
27
- # Important options
26
+ ## Important options
28
27
 
29
- | Option | Description | Default |
30
- |----------------------------|-------------------------------------------------------------------------------------|-----------------|
31
- | batch_size | Event batch size to send to LM Logs. | 100 |
32
- | message_key | Key that will be used by the plugin as the system key | "message" |
33
- | lm_property | Key that will be used by LM to match resource based on property |"system.hostname"|
34
- | keep_timestamp | If false, LM Logs will use the ingestion timestamp as the event timestamp | true |
35
- | timestamp_is_key | If true, LM Logs will use a specified key as the event timestamp | false |
36
- | timestamp_key | If timestamp_is_key is set, LM Logs will use this key in the event as the timestamp | "logtimestamp" |
28
+ | Option | Description| Default |
29
+ | --- | --- | --- |
30
+ | batch_size | Event batch size to send to LM Logs.| 100 |
31
+ | message_key | Key that will be used by the plugin as the system key | "message" |
32
+ | lm_property | Key that will be used by LM to match resource based on property | "system.hostname" |
33
+ | keep_timestamp | If false, LM Logs will use the ingestion timestamp as the event timestamp | true |
34
+ | timestamp_is_key | If true, LM Logs will use a specified key as the event timestamp | false |
35
+ | timestamp_key | If timestamp_is_key is set, LM Logs will use this key in the event as the timestamp | "logtimestamp" |
37
36
 
38
37
  See the [source code](lib/logstash/outputs/lmlogs.rb) for the full list of options
39
38
 
@@ -135,17 +135,18 @@ class LogStash::Outputs::LMLogs < LogStash::Outputs::Base
135
135
  end
136
136
 
137
137
  # Symbolize keys if necessary
138
- c[:auth] = {
139
- :access_id => @access_id,
140
- :access_key => @access_key.value,
141
- :eager => true
142
- }
138
+ # c[:auth] = {
139
+ # :user => @access_id,
140
+ # :password => @access_key.value,
141
+ # :eager => true
142
+ # }
143
143
  end
144
+ @logger.debug("manticore client config ", :client => c)
145
+ return c
144
146
  end
145
147
 
146
148
  private
147
149
  def make_client
148
- puts client_config
149
150
  Manticore::Client.new(client_config)
150
151
  end
151
152
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-lmlogs'
3
- s.version = '1.0.0'
3
+ s.version = '1.0.1'
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = "Logstash output plugin for LM Logs"
6
6
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
@@ -6,6 +6,7 @@ require "logstash/event"
6
6
  describe LogStash::Outputs::LMLogs do
7
7
  let(:sample_event) { LogStash::Event.new("message" => "hello this is log") }
8
8
  let(:client) { @lmlogs.client }
9
+ let(:sample_lm_logs_event){{"message" => "hello this is log 1", "_lm.resourceId" => {"test.property" => "host1"}, "timestamp" => "2021-03-22T04:28:55.907121106Z"}}
9
10
 
10
11
  before do
11
12
  @lmlogs = LogStash::Outputs::LMLogs.new(
@@ -47,20 +48,14 @@ describe LogStash::Outputs::LMLogs do
47
48
  @lmlogs.multi_receive([sample_event, sample_event, sample_event, sample_event, sample_event])
48
49
  end
49
50
 
50
- it "max payload exceeded test" do
51
+ it "max payload exceeded" do
51
52
 
52
- document = [{"message" => "hello this is log 1", "_lm.resourceId" => {"test.property" => "host1"}, "timestamp" => "2021-03-22T04:28:55.907121106Z"},
53
- {"message" => "hello this is log 2", "_lm.resourceId" => {"test.property" => "host2"}, "timestamp" => "2021-03-22T04:28:55.907321106Z"},
54
- {"message" => "hello this is log 3", "_lm.resourceId" => {"test.property" => "host3"}, "timestamp" => "2021-03-22T04:28:55.907421106Z"}
55
- ]
53
+ document = [sample_lm_logs_event,sample_lm_logs_event]
56
54
 
57
- lm_logs_event = {"message" => "hello this is log 4", "_lm.resourceId" => {"test.property" => "host3"}, "timestamp" => "2021-03-22T04:28:55.909421106Z"}
58
- document_expected = [{"message" => "hello this is log 4", "_lm.resourceId" => {"test.property" => "host3"}, "timestamp" => "2021-03-22T04:28:55.909421106Z"}]
55
+ lm_logs_event = {"message" => "hello this is log 3", "_lm.resourceId" => {"test.property" => "host3"}, "timestamp" => "2021-03-22T04:28:55.909421106Z"}
56
+ document_expected = [lm_logs_event]
59
57
  expect(client).to receive(:post).once.with("https://localhost.logicmonitor.com/rest/log/ingest",hash_including(:body => LogStash::Json.dump(
60
- [{"message" => "hello this is log 1", "_lm.resourceId" => {"test.property" => "host1"}, "timestamp" => "2021-03-22T04:28:55.907121106Z"},
61
- {"message" => "hello this is log 2", "_lm.resourceId" => {"test.property" => "host2"}, "timestamp" => "2021-03-22T04:28:55.907321106Z"},
62
- {"message" => "hello this is log 3", "_lm.resourceId" => {"test.property" => "host3"}, "timestamp" => "2021-03-22T04:28:55.907421106Z"}
63
- ]
58
+ [sample_lm_logs_event,sample_lm_logs_event]
64
59
  ))).and_call_original
65
60
 
66
61
  document_result = @lmlogs.isValidPayloadSize(document,lm_logs_event,document.to_json.bytesize)
@@ -68,17 +63,11 @@ describe LogStash::Outputs::LMLogs do
68
63
  end
69
64
  it "max payload in limit" do
70
65
 
71
- document = [{"message" => "hello this is log 1", "_lm.resourceId" => {"test.property" => "host1"}, "timestamp" => "2021-03-22T04:28:55.907121106Z"},
72
- {"message" => "hello this is log 2", "_lm.resourceId" => {"test.property" => "host2"}, "timestamp" => "2021-03-22T04:28:55.907321106Z"},
73
- {"message" => "hello this is log 3", "_lm.resourceId" => {"test.property" => "host3"}, "timestamp" => "2021-03-22T04:28:55.907421106Z"}
74
- ]
66
+ document = [sample_lm_logs_event]
75
67
 
76
- lm_logs_event = {"message" => "hello this is log 4", "_lm.resourceId" => {"test.property" => "host3"}, "timestamp" => "2021-03-22T04:28:55.909421106Z"}
68
+ lm_logs_event = {"message" => "hello this is log 2", "_lm.resourceId" => {"test.property" => "host3"}, "timestamp" => "2021-03-22T04:28:55.909421106Z"}
77
69
 
78
- document_expected = [{"message" => "hello this is log 1", "_lm.resourceId" => {"test.property" => "host1"}, "timestamp" => "2021-03-22T04:28:55.907121106Z"},
79
- {"message" => "hello this is log 2", "_lm.resourceId" => {"test.property" => "host2"}, "timestamp" => "2021-03-22T04:28:55.907321106Z"},
80
- {"message" => "hello this is log 3", "_lm.resourceId" => {"test.property" => "host3"}, "timestamp" => "2021-03-22T04:28:55.907421106Z"},
81
- {"message" => "hello this is log 4", "_lm.resourceId" => {"test.property" => "host3"}, "timestamp" => "2021-03-22T04:28:55.909421106Z"}]
70
+ document_expected = [sample_lm_logs_event,lm_logs_event]
82
71
  expect(client).to receive(:post).exactly(0).times.and_call_original
83
72
 
84
73
  document_result = @lmlogs.isValidPayloadSize(document,lm_logs_event,document.to_json.bytesize + lm_logs_event.to_json.bytesize)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-lmlogs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - LogicMonitor
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-01 00:00:00.000000000 Z
11
+ date: 2022-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  - !ruby/object:Gem::Version
114
114
  version: '0'
115
115
  requirements: []
116
- rubygems_version: 3.1.6
116
+ rubygems_version: 3.2.29
117
117
  signing_key:
118
118
  specification_version: 4
119
119
  summary: Logstash output plugin for LM Logs