-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinjector.py
More file actions
32 lines (24 loc) · 764 Bytes
/
Copy pathinjector.py
File metadata and controls
32 lines (24 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from elasticsearch import Elasticsearch
from dotenv import load_dotenv
import yaml
import json
import os, sys
import logging
# 로깅 설정
logging.basicConfig(
level=logging.INFO,
format='[%(asctime)s] [%(name)s] [%(levelname)s] %(message)s',
handlers=[
logging.StreamHandler(sys.stdout)
]
)
logger = logging.getLogger("FastAPI_Deps_REST_API")
def get_headers():
''' Elasticsearch Header '''
return {'Content-type': 'application/json', 'Connection': 'close'}
load_dotenv()
es_client = Elasticsearch(hosts= os.getenv("ELASTICSEARCH_HOST", "localhost:9200"),
headers=get_headers(),
verify_certs=False,
timeout=600
)