sensu-handlers-elasticsearch 0.0.2 → 0.0.3

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
2
  SHA1:
3
- metadata.gz: 8c39adbe4de69c69b698bd7ff69e4d38874480c1
4
- data.tar.gz: c04eaee0aba2c5d4865f65c719e0f72c364ca38c
3
+ metadata.gz: 6b7e91f0b3521822ea91deca9442f3d73fb3b7fc
4
+ data.tar.gz: c9b3e7d238c57aa556c4c9e8f5731e790a9a5db4
5
5
  SHA512:
6
- metadata.gz: 9a6bb95af737a2ae3afc58ce17091adf5f3844de6ba4fff300dbbed3797bdfb7c760796ccbc96c63af7e59fe0484bc3a8d77598f213b2d7598f23aa78608e39a
7
- data.tar.gz: 4cfc88fd7f2cccf662dabe6fff2d73d2201c4662721998a594a0881ecf7ff2c4261b819ad9fb66f0a062673bfccccc8da39d87d73a80110509ae50bbb117bd91
6
+ metadata.gz: e6ed829cea39ab60b2637f216afd435651307278a2152fda9865d2033553f80b024224c9271c09cac31254b817568e4fa2afacd4344990db40b7dcbe81b35231
7
+ data.tar.gz: d3c6327aac5ed11e03f550e9ae50717c008599923cb191f3fe92e45fe973c735efb57d4542be7cac3967b867077c14d4473ea8b3eec4861701b77f7c7506bb86
@@ -5,6 +5,10 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
5
5
 
6
6
  ## Unreleased
7
7
 
8
+ ## [0.0.3] - 2016-01-12
9
+ ### Added
10
+ - Using strftime for better formatting
11
+
8
12
  ## [0.0.2] - 2016-01-12
9
13
  ### Added
10
14
  - Adding support for date interpolation in the ES index
data/README.md CHANGED
@@ -8,7 +8,7 @@ The handler accepts the following command line options:
8
8
 
9
9
  ```
10
10
  Usage: handler-elasticsearch.rb (options)
11
- -i, --index <INDEX> Elasticsearch index (default: sensu)
11
+ -i, --index <INDEX> Elasticsearch index (default: sensu-%{Y}.%{m}.%{d})
12
12
  -t, --type <TYPE> Elasticsearch index type (default: handler)
13
13
  -u, --url <URL> Elasticsearch URL
14
14
  ```
@@ -47,7 +47,8 @@ class HandlerElasticsearch < Sensu::Handler
47
47
  }
48
48
 
49
49
  # interpolate %Y, %m and %d with today's date
50
- index = config[:index] % {:Y => Time.now.year, :m => Time.now.month, :d => Time.now.day}
50
+ now = Time.now
51
+ index = config[:index] % {:Y => now.strftime('%Y'), :m => now.strftime('%m'), :d => now.strftime('%d')}
51
52
 
52
53
  uri = URI("#{config[:url]}/#{index}/#{config[:type]}/#{@event['id']}")
53
54
  http = Net::HTTP.new(uri.host, uri.port)
@@ -2,7 +2,7 @@ module SensuHandlersElasticsearch
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- PATCH = 2
5
+ PATCH = 3
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-handlers-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matteo Cerutti