ElasticSearch Reference

Authentication

  $ PASSWORD=$(kubectl get secret elk-es-elastic-user -n elasticsearch -o
go-template='{{.data.elastic | base64decode}}')
 

Index

# List Index

$ curl -XGET -u "elastic:${PASSWORD}" -k "https://localhost:9200/_cat/indices"

CRUD

Create Data

curl -XPUT “https://es.inthewear.com:9200/test-index/_doc/1”
-u “elastic:${PASSWORD}”
-H ‘Content-Type: application/json’
-d ‘ {“name”: “Anderson”, “data”: {“name”: “Matrix”, “price”: 2500.5}, “/api/path”: {“name”: “Twitter”, “value”: 23.5}, “created_at” : “2022-04-04T11:39:47.325156”, “created_timezone_at”: “2022-04-04T11:39:06.140117+09:00” }’