In this guide you will learn how to quickstart with detailed logging using opensearch.
docker pull opensearchproject/opensearch:latest
docker pull opensearchproject/opensearch-dashboards:latest
docker run -d -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" -e "plugins.security.disabled=true" opensearchproject/opensearch:latest
docker run -it -d --network="host" -e "DISABLE_SECURITY_DASHBOARDS_PLUGIN=true" opensearchproject/opensearch-dashboards:latest
Send a request to port 9200
curl http://127.0.0.1:9200
List Indices through curl
curl -X GET "http://127.0.0.1:9200/_cat/indices?v"
Create Indices through Curl
curl -X PUT "http://127.0.0.1:9200/your_index_name"
Delete Index
curl --location --request DELETE 'http://127.0.0.1:9200/index_name'
Fetch logs for an index_name
curl --location --request GET 'http://127.0.0.1:9200/ethereal/_search' \
--header 'Content-Type: application/json' \
--data '{
"query": {
"match_all": {}
},
"size": 10000
}'
Configure these variables in the .env.local
file to ensure proper communication with OpenSearch and to enable client and server log aggregation
Set VITE_FORCE_CLIENT_LOG_AGGREGATE
to true to enable client log aggregation
VITE_FORCE_CLIENT_LOG_AGGREGATE=true
Set DISABLE_SERVER_LOG
to false to enable server log aggregation
DISABLE_SERVER_LOG=false