es-grep 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.rdoc +3 -10
  2. data/VERSION +1 -1
  3. data/bin/esgrep +13 -11
  4. metadata +2 -2
@@ -1,16 +1,9 @@
1
1
  = es-grep
2
2
 
3
- Description goes here.
3
+ A grep like tool for querying ElasticSearch clusters.
4
+ es-grep -p ERROR es.cluster.company.com
4
5
 
5
- == Contributing to es-grep
6
-
7
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
8
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
9
- * Fork the project.
10
- * Start a feature/bugfix branch.
11
- * Commit and push until you are happy with your contribution.
12
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
6
+ Requires Ruby >= 1.9.
14
7
 
15
8
  == Copyright
16
9
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
data/bin/esgrep CHANGED
@@ -168,20 +168,22 @@ Main {
168
168
  "from" => 0, "size" => params[:limit].value,
169
169
 
170
170
  "query" => {
171
- "query_string" => {
172
- "query" => query,
173
- "default_field" => params[:field].value
174
- }
171
+ "bool" => {
172
+ "must" => []
175
173
  }
176
174
  }
175
+ }
177
176
 
178
- if params[:app].given? or params[:host].given?
179
- q["filter"] = {}
180
- q["filter"]["and"] = []
181
- end
177
+ q["query"]["bool"]["must"] <<
178
+ {
179
+ "query_string" => {
180
+ "query" => query,
181
+ "default_field" => params[:field].value
182
+ }
183
+ }
182
184
 
183
185
  if params[:app].given?
184
- q["filter"]["and"] <<
186
+ q["query"]["bool"]["must"] <<
185
187
  {
186
188
  "term" => {
187
189
  "appname" => params[:app].value,
@@ -190,9 +192,9 @@ Main {
190
192
  end
191
193
 
192
194
  if params[:host].given?
193
- q["filter"]["and"] <<
195
+ q["query"]["bool"]["must"] <<
194
196
  {
195
- "term" => {
197
+ "text" => {
196
198
  "hostname" => params[:host].value
197
199
  }
198
200
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: es-grep
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-03 00:00:00.000000000 Z
12
+ date: 2012-08-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: main