max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
$ sudo sysctl -w vm.max_map_count=262144
Details
$ curl localhost:9200/_cat/indices
$ curl localhost:9200/_cluster/health?pretty=true
$ curl localhost:9200/_cluster/health/{index_name}?pretty=true
$ curl localhost:9200/{index_name}/_search?pretty=true
Details
$ curl -XPUT localhost:9200/{{index}} -H 'content-type:application/json' -d \
{
"settings": {
"analysis": {
"analyzer": {
"email_analyzer": {
"type": "custom",
"tokenizer": "uax_url_email"
}
}
}
}
}
Details
$ curl -XPUT localhost:9200/{{index}}/_doc/_mapping?include_type_name=true -H 'content-type:application/json' -d \
{
"properties": {
"request_epoch_time": {
"type": "date"
},
"response_epoch_time": {
"type": "date"
},
"request_id": {
"type": "text",
"analyzer": "email_analyzer",
"search_analyzer": "email_analyzer",
"fielddata": true
}
}
}
Details
$ curl -XPOST localhost:9200/_reindex -H 'content-type:application/json' -d \
{
"source": { "index": "testnet_history" },
"dest": { "index": "testnet_history_20200603" }
}
Details
$ curl -XPOST localhost:9200/{index}/_update/{_id} -d \
{
"script": {
"source": "ctx._source.field = params.jsonInput.toString()",
"lang": "painless",
"params": {
"jsonInput": {
"a": 1,
"b": "test",
"c": {}
}
}
}
}
$ curl -XPOST localhost:9200/{index}/_update/{_id} -d \
{
"doc" : {
"field" : ""
}
}
Details
GET ${INDEX}/_search
{
"query":
{
"range":
{
"fstCrtDtmIns":
{
"gte": "2020-08-13 12:00:00.000",
"lte": "2020-08-13 23:59:59.999",
"format": "yyyy-MM-dd HH:mm:ss.SSS",
"time_zone": "+09:00"
}
}
}
}
Details
GET ${INDEX}/_search
{
"query": {
},
"aggs": {
"NAME": {
"max": {
"field": "${fieldName}"
}
}
}
}
Details
GET ${INDEX}/_count
{
"query": {
}
}
Details
# Register Snapshot repository (path.repo in elasticsearch.yaml)
curl -XPUT -H 'content-type: application/json' localhost:9200/_snapshot/es_backup -d '{"type":"fs","settings":{"location":"/tmp/es_backup"}}'
# Get Snapshot Info
curl -XGET -H 'content-type: application/json' localhost:9200/_snapshot/es_backup
# Create Snapshot
curl -XPUT -H 'content-type: application/json' localhost:9200/_snapshot/es_backup/snapshot_1
# Close Index (metricbeat index)
# After Restore Index, then it automatically open
curl -XPOST -H 'content-type: application/json' localhost:9200/metricbeat/_close
# Restore
curl -XPOST -H 'content-type: application/json' localhost:9200/_snapshot/es_backup/snapshot_1/_restore -d '{"ignore_unavailable":true}'
Details
$ curl -X POST $ES_ENDPOINT/_bulk -H 'cache-control: no-cache' -H 'content-type: application/json' --write-out "%{http_code}\n" --silent --output /dev/null --data-binary @{json_file_name}