python에서 검색을 위해 elasticsearch 모듈 설치/사용
(elk 서버는 미리 설치해서 구성)
1. elk 모듈 설치
pip install pyelasticsearch
2. elk 모듈 사용
from pyelasticsearch import ElasticSearch
from pyelasticsearch.exception import IndexAlreadyExistsError
o_es = ElasticSearch('http://localhost:9200/')
try:
o_es.create_index('test')
except IndexAlreadyExistsError, e:
pass
'Language > python' 카테고리의 다른 글
| python supervisord 구성 (0) | 2018.01.04 |
|---|---|
| python 버전 바꾸기 (0) | 2018.01.03 |
| python fabric 설치 (0) | 2017.06.06 |
| python virtualenv 생성 (0) | 2017.06.01 |
| python 인스톨 스크립트 작성 (0) | 2017.05.30 |