파이썬을 이용하여 Elasticsearch에 index 생성하고, 삭제하는 방법으로 모니터링
try:
es = Elasticsearch(hosts=' ', port=' ')
doc = '''
{
"mappings": {
"testindex": {
"properties": {
"msg": {
"type": "keyword"
}
}
}
}
}'''
res = es.indices.create(index='testindex', body=doc)
print('index create : %s' %res['acknowledged'])
res = es.indices.delete(index='testindex')
print('index delete : %s' %res['acknowledged'])
except Exception as e:
print(e)
------------------------------------------------------------------
index create : True
index delete : True
'Elasticsearch' 카테고리의 다른 글
[Python] Insert bulk from pandas dataframe to elasticsearch (0) | 2020.02.15 |
---|---|
CentOS 7 Auditbeat 7.0 OSS RPM Install (0) | 2019.04.29 |
CentOS 7 Elasticsearch / kibana 7.0 OSS RPM Install (0) | 2019.04.29 |
[elastic] winlogbeat (윈도이벤트 로그 경량 수집기) - 설치 (0) | 2019.03.20 |
[Elasticsearch] Numeric(숫자) Data Types (0) | 2018.07.14 |
Beat(비트) 윈도우 서비스에 등록하기 (0) | 2018.07.02 |
JDBC를 이용하여 logstash 연동 - MSSQL (0) | 2018.07.01 |
Kibana설치 - Windows 2012 (0) | 2018.06.25 |