plunk 0.3.6 → 0.3.7

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
  SHA1:
3
- metadata.gz: a4fcef327ceef5a024209f7d80de3dfb0dd9c148
4
- data.tar.gz: 9dc0010678517ceff2ef0ee08c780563f381e462
3
+ metadata.gz: 6c087cc562303642c7d9b652826777dd3f5c619a
4
+ data.tar.gz: dda76e41f929a5fde5a17e647f590c25f61e6c28
5
5
  SHA512:
6
- metadata.gz: 58a21a8d5ccfd41c5979c976c080bf3b492b0e008709dab496bdb766c08f33f3784395e9a91eb8ac9b95200bb3c5a1a89f5c18b5dd638efb23e278a5d281b10b
7
- data.tar.gz: f766b5aced60195ef8452ea7f90689def798ce5f67f07270dff257be56ee6ce5823b02ec1388d4942da56d9048ed62cd012fdf232790a03dbe3b81c5089eaf3e
6
+ metadata.gz: 2d7e3988dabdd28807f05b734cbcdc4eac4bc7942f95df0963bed087820e9a8c8f23c325e46b920635af0ad6f5043ad7739ee792cbc6db22ce2b7642dc8f23b5
7
+ data.tar.gz: 56a9fcaaf6104c5b456b840a4cbf7f2f17eb51eb92cdb9a3dc708b19d614755a3d93f72da74d3baeac1a62d4d4d8333b8501eeff48ae4481c87333776f9938fc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- plunk (0.3.5)
4
+ plunk (0.3.6)
5
5
  activesupport (~> 4.0, >= 4.0.0)
6
6
  chronic (~> 0.10, >= 0.10.0)
7
7
  elasticsearch
@@ -41,10 +41,10 @@ GEM
41
41
  rspec-core (~> 2.14.0)
42
42
  rspec-expectations (~> 2.14.0)
43
43
  rspec-mocks (~> 2.14.0)
44
- rspec-core (2.14.7)
45
- rspec-expectations (2.14.4)
44
+ rspec-core (2.14.8)
45
+ rspec-expectations (2.14.5)
46
46
  diff-lcs (>= 1.1.3, < 2.0)
47
- rspec-mocks (2.14.4)
47
+ rspec-mocks (2.14.6)
48
48
  thread_safe (0.3.3)
49
49
  timecop (0.7.1)
50
50
  tzinfo (1.1.0)
@@ -0,0 +1,25 @@
1
+ {
2
+ "query":{
3
+ "filtered":{
4
+ "filter":{
5
+ "and":[
6
+ {
7
+ "range":{
8
+ "timestamp":{
9
+ "gte":"2014-04-01T16:00:00.000+00:00",
10
+ "lte":"2014-04-07T16:00:00.000+00:00"
11
+ }
12
+ }
13
+ },
14
+ {
15
+ "query":{
16
+ "query_string":{
17
+ "query":"_type:syslog"
18
+ }
19
+ }
20
+ }
21
+ ]
22
+ }
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,10 @@
1
+ $LOAD_PATH << './lib'
2
+ require './lib/plunk'
3
+
4
+ Plunk.configure do |c|
5
+ c.elasticsearch_options = { host: 'localhost' }
6
+ c.timestamp_field = :timestamp
7
+ end
8
+
9
+ query = 'window "last monday" to "last tuesday" & _type = syslog'
10
+ puts Plunk.search query
data/plunk.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "plunk"
3
- s.version = "0.3.6"
3
+ s.version = "0.3.7"
4
4
  s.add_runtime_dependency "json", "~> 1.8", ">= 1.8.0"
5
5
  s.add_runtime_dependency "parslet", "~> 1.5", ">= 1.5.0"
6
6
  s.add_runtime_dependency "elasticsearch"
data/spec/window_spec.rb CHANGED
@@ -39,4 +39,16 @@ describe 'the window command' do
39
39
  )
40
40
  expect(result).to eq(expected)
41
41
  end
42
+
43
+ it 'should parse NOT window -60m to -30m' do
44
+ result = Plunk.search 'NOT window -60m to -30m'
45
+ expected = Plunk::Helper.filter_builder(
46
+ not:
47
+ Plunk::Helper.range_builder(
48
+ Plunk::Helper.timestamp_format(@time - 60.minutes),
49
+ Plunk::Helper.timestamp_format(@time - 30.minutes)
50
+ )
51
+ )
52
+ expect(result).to eq(expected)
53
+ end
42
54
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plunk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ram Mehta
@@ -164,6 +164,8 @@ files:
164
164
  - README.md
165
165
  - Rakefile
166
166
  - bin/plunk
167
+ - examples/simple.json
168
+ - examples/simple.rb
167
169
  - lib/plunk.rb
168
170
  - lib/plunk/helper.rb
169
171
  - lib/plunk/parser.rb