Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add explicit authentication #17

Merged
merged 4 commits into from
Oct 31, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion es2csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def __init__(self, opts):

@retry(elasticsearch.exceptions.ConnectionError, tries=TIMES_TO_TRY)
def create_connection(self):
es = elasticsearch.Elasticsearch(self.opts.url, timeout=CONNECTION_TIMEOUT)
es = elasticsearch.Elasticsearch(self.opts.url, timeout=CONNECTION_TIMEOUT, http_auth=self.opts.auth)
es.cluster.health()
self.es_conn = es

Expand Down Expand Up @@ -264,6 +264,7 @@ def main():
p.add_argument('-k', '--kibana_nested', dest='kibana_nested', action='store_true', help='Format nested fields in Kibana style.')
p.add_argument('-r', '--raw_query', dest='raw_query', action='store_true', help='Switch query format in the Query DSL.')
p.add_argument('-e', '--meta_fields', dest='meta_fields', action='store_true', help='Add meta-fields in output.')
p.add_argument('-a', '--auth', dest='auth', type=str, required=False, help='Elastic search basic authentication in the form of username:password')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add dot (.) at the end of sentence and please add documentation to readme about this option.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for considering the PR. I fixed the typos and added the option as well as an explicit example in your readme file.

Thanks,

Artur

p.add_argument('-v', '--version', action='version', version='%(prog)s ' + __version__, help='Show version and exit.')
p.add_argument('--debug', dest='debug_mode', action='store_true', help='Debug mode on.')

Expand Down