Skip to content

Commit

Permalink
1.3 release
Browse files Browse the repository at this point in the history
add a -t/--timeout flag
  • Loading branch information
tedwardia committed Jan 15, 2018
1 parent 108552c commit 3214c74
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions bin/esgrep
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ parser.add_argument('query',
'OR a file containing an Elasticsearch query ' +
'(using the full Elasticsearch query DSL)')
)
parser.add_argument('-t', '--timeout',
default=30.0,
help='how long to wait for a response from Elasticsearch (defaults to 30 seconds)'
)
parser.add_argument('-j', '--json',
action='store_true',
help='return all (_source) fields as json'
Expand Down Expand Up @@ -77,6 +81,7 @@ def get_scroller(es, query, args):
es,
query,
index=args.index,
request_timeout=float(args.timeout),
preserve_order=True
)

Expand All @@ -85,6 +90,7 @@ def get_aggs(es, query, args):
""" run a query and return only the queries aggregations """
return es.search(index=args.index,
body=query,
timeout=float(args.timeout),
filter_path=['aggregations'])


Expand Down
10 changes: 6 additions & 4 deletions rpmbuild/SPECS/esgrep.spec
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Name: esgrep
Version: 1.2
Version: 1.3
Release: 0%{dist}
Summary: Tool for running Kibana style queries from the command line

Group: Applications/System
License: none
URL: N/A
Source0: esgrep-1.2-0.tar.gz
Source0: esgrep-1.3-0.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildArch: noarch
Requires: python, python-elasticsearch, PyYAML
Expand Down Expand Up @@ -39,5 +39,7 @@ rm -rf %{buildroot}


%changelog
* Thu Jan 04 2018 Ted Wells <[email protected]> - 1.0
- initial release
* Mon Jan 15 2018 Ted Wells <[email protected]> - 1.3
- add -t/--timeout flags
* Thu Jan 04 2018 Ted Wells <[email protected]> - 1.2
- initial (rpm) release

0 comments on commit 3214c74

Please sign in to comment.