graylogapi 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 935e0873c8bf8d85ed280b4805334e5f5db69de6
4
- data.tar.gz: a4e92c51db6504f9b2162e53f903d4628b17e80e
2
+ SHA256:
3
+ metadata.gz: 80ae6f1028a7836d42b3d8d292b99e5ccbcf7115b57b1ed22609e6f9e04a48ee
4
+ data.tar.gz: 7cc20688412dd03b84ca60e888598c7089c9970a3867c6d92d379c4c5064fe00
5
5
  SHA512:
6
- metadata.gz: 4e501fabaa1ccf084e0056ffbd3b053e467aa9aec4f9992108a097bfb8dedc0bc686cb91db21ffefe0fe39266ab57964f9b43642fd39312ab2e8e678f8666b8b
7
- data.tar.gz: 6c8db390c781c37ce269c1dc7e53cbf148d37ac57eeac9f0dbd34cabee0bd0e065080f76cc3cbf1bc8e59d04799bbe03ccdc9633583db137745d4bd9631f2c50
6
+ metadata.gz: 627acad0ee43670d72476ff48258b9d666398f53759ccc26aa838f9e25f0cc2356f8cf6f36e8d0cce036d43a433b0109a017f6aa95718bb33983aa08ec5d7932
7
+ data.tar.gz: d20ee8509e0520cad23b4ea845272183976a93f7636383c1857f500836a6042fe617c3a098453352c87ea96c762731811243ce77c9e2e0b476557abaa2ed8e47
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2017 Andrey Aleksandrov
3
+ Copyright (c) 2017-2018 Andrey Aleksandrov, Robert Waffen
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,16 +1,17 @@
1
1
  # GraylogAPI
2
2
 
3
- [![Gem Version](https://img.shields.io/gem/v/graylogapi.svg)][gem]
4
- [![Build Status](http://img.shields.io/travis/postgred/graylogapi.svg)][travis]
3
+ [![Gem Version](https://badge.fury.io/rb/graylogapi.svg)](https://badge.fury.io/rb/graylogapi)
4
+ [![Build Status](https://travis-ci.com/rwaffen/graylogapi.svg?branch=master)](https://travis-ci.com/rwaffen/graylogapi)
5
5
 
6
6
  [gem]: https://rubygems.org/gems/graylogapi
7
- [travis]: https://travis-ci.org/postgred/graylogapi
7
+ [travis]: https://travis-ci.com/rwaffen/graylogapi
8
8
 
9
- Ruby gem for working with [Graylog](https://www.graylog.org/) via the [Graylog REST API](http://docs.graylog.org/en/2.2/pages/configuration/rest_api.html?highlight=API)
9
+ Ruby gem for working with [Graylog](https://www.graylog.org/) via the [Graylog REST API](http://docs.graylog.org/en/2.4/pages/configuration/rest_api.html?highlight=API)
10
10
 
11
11
  ## Installation
12
12
 
13
13
  gem install graylogapi
14
+
14
15
  ## Dependencies
15
16
 
16
17
  - net/http
@@ -22,7 +23,7 @@ Ruby gem for working with [Graylog](https://www.graylog.org/) via the [Graylog R
22
23
  - [Graylog API docs][GraylogAPI]
23
24
 
24
25
  [Graylog]: https://www.graylog.org/
25
- [GraylogAPI]: http://docs.graylog.org/en/2.2/pages/configuration/rest_api.html?highlight=API
26
+ [GraylogAPI]: http://docs.graylog.org/en/2.4/pages/configuration/rest_api.html?highlight=API
26
27
 
27
28
  ## Usage
28
29
 
@@ -52,7 +53,7 @@ graylogapi = GraylogAPI.new(base_url: 'http://localhost:9000/api', token: 'token
52
53
  #### get Input by id
53
54
 
54
55
  graylogapi = GraylogAPI.new(base_url: 'http://localhost:9000/api', user: 'username', pass: 'password')
55
-
56
+
56
57
  graylogapi.system.inputs.by_id('5947d3840b5712166af25009')
57
58
 
58
59
  You can find more examples [here](./examples/)
@@ -72,6 +73,9 @@ You can find more examples [here](./examples/)
72
73
  * **StaticFields**: Static fields of an input.
73
74
  * create(input_id, params) — Add a static field to an input.
74
75
  * delete(input_id, key) — Remove static field of an input.
76
+ * **Extractors**: Extractors of an input.
77
+ * create(input_id, params) — Add a extractor to an input.
78
+ * delete(input_id, key) — Remove extractor of an input.
75
79
  * **Streams**: Manage streams
76
80
  * all — Get a list of all streams.
77
81
  * create(params) — Create a stream.
@@ -117,8 +121,8 @@ You can find more examples [here](./examples/)
117
121
 
118
122
  ## Copyright
119
123
 
120
- Copytight (c) 2017 Andrey Aleksandrov
124
+ Copytight (c) 2017-2018 Andrey Aleksandrov, Robert Waffen
121
125
 
122
126
  See [LICENSE][] for details.
123
127
 
124
- [license]: LICENSE.md
128
+ [license]: LICENSE
data/graylogapi.gemspec CHANGED
@@ -7,13 +7,13 @@ require 'graylogapi/version'
7
7
  Gem::Specification.new do |spec|
8
8
  spec.name = 'graylogapi'
9
9
  spec.version = GraylogAPI::VERSION
10
- spec.authors = ['Andrey Aleksandrov']
11
- spec.email = ['postgred@gmail.com']
10
+ spec.authors = ['Andrey Aleksandrov', 'Robert Waffen']
11
+ spec.email = ['postgred@gmail.com', 'rwaffen@gmail.com']
12
12
  spec.license = 'MIT'
13
13
 
14
14
  spec.summary = 'Ruby gem for working with Graylog API'
15
15
  spec.description = 'Allows you to work with graylog api from ruby'
16
- spec.homepage = 'https://github.com/postgred/graylogapi'
16
+ spec.homepage = 'https://github.com/rwaffen/graylogapi'
17
17
 
18
18
  spec.files = ['README.md', 'graylogapi.gemspec', 'LICENSE'] +
19
19
  Dir['lib/**/*.rb']
@@ -0,0 +1,26 @@
1
+ class GraylogAPI
2
+ # class for manage Extractors of an input
3
+ class Extractors
4
+ def initialize(client)
5
+ @client = client
6
+ end
7
+
8
+ # add key to an input
9
+ #
10
+ # @param input_id [Integer] id of an input
11
+ # @param params [Hash] hash with key and value of new extractor
12
+ # @return [GraylogAPI::Client::Response]
13
+ def create(input_id, params)
14
+ @client.request(:post, "/system/inputs/#{input_id}/extractors", params)
15
+ end
16
+
17
+ # delete key of an input
18
+ #
19
+ # @param input_id [Integer] id of an input
20
+ # @param key [String] key of extractor
21
+ # @return [GraylogAPI::Client::Response]
22
+ def delete(input_id, key)
23
+ @client.request(:delete, "/system/inputs/#{input_id}/extractors/#{key}")
24
+ end
25
+ end
26
+ end
@@ -1,3 +1,3 @@
1
1
  class GraylogAPI
2
- VERSION = '1.3.0'.freeze
2
+ VERSION = '1.3.1'.freeze
3
3
  end
data/lib/graylogapi.rb CHANGED
@@ -5,6 +5,7 @@ require 'graylogapi/alerts'
5
5
  require 'graylogapi/client'
6
6
  require 'graylogapi/dashboards'
7
7
  require 'graylogapi/static_fields'
8
+ require 'graylogapi/extractors'
8
9
  require 'graylogapi/streams'
9
10
  require 'graylogapi/system'
10
11
  require 'graylogapi/users'
@@ -48,6 +49,11 @@ class GraylogAPI
48
49
  @static_fields ||= StaticFields.new(@client)
49
50
  end
50
51
 
52
+ # @return [GraylogAPI::Extractors]
53
+ def extractors
54
+ @extractors ||= Extractors.new(@client)
55
+ end
56
+
51
57
  # @return [GraylogAPI::Users]
52
58
  def users
53
59
  @users ||= Users.new(@client)
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graylogapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Aleksandrov
8
+ - Robert Waffen
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2017-10-22 00:00:00.000000000 Z
12
+ date: 2018-11-19 00:00:00.000000000 Z
12
13
  dependencies: []
13
14
  description: Allows you to work with graylog api from ruby
14
15
  email:
15
16
  - postgred@gmail.com
17
+ - rwaffen@gmail.com
16
18
  executables: []
17
19
  extensions: []
18
20
  extra_rdoc_files: []
@@ -25,6 +27,7 @@ files:
25
27
  - lib/graylogapi/client.rb
26
28
  - lib/graylogapi/client/response.rb
27
29
  - lib/graylogapi/dashboards.rb
30
+ - lib/graylogapi/extractors.rb
28
31
  - lib/graylogapi/static_fields.rb
29
32
  - lib/graylogapi/streams.rb
30
33
  - lib/graylogapi/system.rb
@@ -34,7 +37,7 @@ files:
34
37
  - lib/graylogapi/system/inputs/types.rb
35
38
  - lib/graylogapi/users.rb
36
39
  - lib/graylogapi/version.rb
37
- homepage: https://github.com/postgred/graylogapi
40
+ homepage: https://github.com/rwaffen/graylogapi
38
41
  licenses:
39
42
  - MIT
40
43
  metadata: {}
@@ -54,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
57
  version: '0'
55
58
  requirements: []
56
59
  rubyforge_project:
57
- rubygems_version: 2.6.11
60
+ rubygems_version: 2.7.7
58
61
  signing_key:
59
62
  specification_version: 4
60
63
  summary: Ruby gem for working with Graylog API