GET http://172.16.18.114:9200/_cluster/health
HEAD http://172.16.18.114:9200/logstash-2016.01.07
PUT http://172.16.18.116:9200/test
{
"settings" : {
"index" : {
"number_of_shards" : 3,
"number_of_replicas" : 2
}
}
}
GET http://172.16.18.116:9200/cdr-2015-08-30/_mappings
PUT http://172.16.18.116:9200/logstash-2015.11.17/heartbeat/_mappings
{
"_ttl": {
"enabled": true,
"default": "3d"
},
"properties": {
"message": {
"index": "no",
"type": "string"
},
"@timestamp": {
"format": "dateOptionalTime",
"type": "date"
},
"host": {
"index": "no",
"type": "string"
}
},
"_all": {
"enabled": false
}
}
GET http://172.16.18.114:9200/logstash-2015.12.30/_settings
PUT http://172.16.18.116:9200/.marvel-kibana/_settings
{
"index" : {
"number_of_replicas" : 0
}
}
GET http://172.16.18.116:9200/cdr-2015-08-30/_stats
POST http://172.16.18.114:9200/logstash-2015.11*/_close
GET http://172.16.18.116:9200/_nodes/stats/indices/search
GET http://172.16.18.116:9200/_nodes/elasticsearch_114/settings
GET http://172.16.18.114:9200/_stats/store
GET http://172.16.18.114:9200/_nodes/elasticsearch_114/plugins?pretty=true
GET http://172.16.18.116:9200/_stats
POST http://172.16.18.116:9200/my_index/_search?fields=_all,_source,full_name
{
"query": {
"match": {
"_all": "John Smith"
}
},
"highlight": {
"fields": {
"_all": {},
"full_name": {}
}
}
}
GET http://172.16.18.116:9200/kibana-int/_search
GET http://172.16.18.116:9200/cdr-2015-10-21/u2_gcdr/_count
POST http://172.16.18.116:9200/jfyindex/_search
{
"query" : {
"match" : {
"_all": "rock climbing"
}
}
}
GET http://172.16.18.116:9200/jfy*/_search
GET http://172.16.18.116:9200/jfyindex/_search?q="rock climbing"
POST http://172.16.18.116:9200/jfyindex/_search?q="rock climbing"
{
"query" : {
"match_phrase" : {
"_all": "rock climbing"
}
}
}
POST http://172.16.18.116:9200/cdr*/_search
{
"query" : {
"match" : {
"msisdn": "85267944762"
}
}
}
POST http://172.16.18.116:9200/logstash-2015.08.01/_analyze O_Str[9]=20150630-111344
POST http://172.16.18.116:9200//_validate/query?explain
{
"query": {
"query_string": {
"query": "abc"
}
}
}
PUT http://172.16.18.116:9200/_template/cdr
{
"order": 0,
"template": "cdr*", "settings": { "index.refresh_interval": "30m", "index.number_of_replicas": "1", "index.number_of_shards": "1", "index.translog.flush_threshold_ops": "100000" }, "mappings": { "_default_": { "dynamic_templates": [ { "string_fields": { "mapping": { "index": "not_analyzed", "omit_norms": true, "type": "string" }, "match": "*",
"match_mapping_type": "string"
}
}
],
"_all": {
"enabled": true
},
"date_detection": false
},
"hjscdr": {
"properties": {
"starttime": {
"index": "not_analyzed",
"type": "string"
},
"msisdn": {
"index": "not_analyzed",
"type": "string"
},
"rectype": {
"index": "no",
"type": "string"
},
"pdp_address": {
"index": "not_analyzed",
"type": "string"
},
"roaming_charge": {
"type": "long"
},
"unit": {
"type": "long"
},
"totallink": {
"type": "long"
},
"@timestamp": {
"type": "long"
},
"startdate": {
"index": "not_analyzed",
"type": "string"
},
"charging_item": {
"index": "not_analyzed",
"type": "string"
},
"sgsn": {
"index": "not_analyzed",
"type": "string"
},
"imsi": {
"index": "not_analyzed",
"type": "string"
},
"apn": {
"index": "not_analyzed",
"type": "string"
},
"uplink": {
"type": "long"
},
"ggsn": {
"index": "not_analyzed",
"type": "string"
},
"downlink": {
"type": "long"
}
}
}
}
}
PUT http://172.16.18.116:9200/_template/logstash
{
"order": 99,
"template": "logstash-*",
"settings": {
"index.refresh_interval": "5s",
"index.number_of_replicas": "1",
"index.number_of_shards": "1",
"index.translog.flush_threshold_ops": "5000"
},
"mappings": {
"_default_": {
"_all": {
"enabled": true,
"omit_norms": true
},
"dynamic_templates": [
{
"message_field": {
"match": "message",
"match_mapping_type": "string",
"mapping": {
"type": "string",
"index": "analyzed",
"omit_norms": true
}
}
},
{
"string_fields": {
"match": "*",
"match_mapping_type": "string",
"mapping": {
"type": "string",
"index": "analyzed",
"omit_norms": true,
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed",
"ignore_above": 256
}
}
}
}
}
],
"properties": {
"@version": {
"type": "string",
"index": "not_analyzed"
},
"geoip": {
"type": "object",
"dynamic": true,
"properties": {
"location": {
"type": "geo_point"
}
}
}
}
}
}
}
}
POST http://172.16.18.116:9200/_flush
PUT http://172.16.18.116:9200/cdr*/_settings
{
"index.translog.flush_threshold_ops": 5000,
"index.refresh_interval": "5s"
}
GET http://172.16.18.179:9200/_cat/nodes?v=&h=name,port,sm
GET http://172.16.18.114:9200/_stats/fielddata
POST http://172.16.18.116:9200/logstash-2015.11.17/heartbeat/_search
{
"query": {
"range": {
"@timestamp": {
"from": 1547330883236,
"to": 1547330883236
}
}
},
"size": 0,
"aggs": {
"max_time": {
"max": {
"field": "@timestamp"
}
}
}
}
GET http://172.16.18.114:9200//_nodes/stats/indices/fielddata?fields=*
https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-fielddata.html
GET http://172.16.18.179:9200/_cat/fielddata?v
实现如mysql的group by功能:
select yearmon(createtime) yearmon,method,status,count(*) from test group by yearmon,method,status
POST http://172.16.18.116:9200/test/_search
{
"size": 0,
"aggs" : {
"day_total" : {
"date_histogram":{
"field": "CreateTime",
"interval": "day",
"format": "yyyyMMdd"
},
"aggs": {
"method_total":{
"terms": {"field": "method"},
"aggs":{
"status_total":{
"terms": {"field": "status"}
}
}
}
}
}
}
}
PUT http://172.16.18.116:9200/_template/template_logstash
{
"template" : "logstash*",
"settings" : {
"number_of_shards" : 1,
"number_of_replicas": 1
},
"mappings" : {
"hostapd.log":{
"_ttl" : { "enabled" : true, "default" : "30d" }
},
"hostapd1.log":{
"_ttl" : { "enabled" : true, "default" : "30d" }
}
}
}
GET http://172.16.18.114:9200//logstash-2016.01.07/_shard_stores
GET http://172.16.18.114:9200/_nodes/*/stats/jvm
PUT http://172.16.18.116:9200/_cluster/settings
{
"transient" : {
"cluster.routing.allocation.enable" : "none"
}
}
PUT http://172.16.18.179:9200/_cluster/settings
{
"transient" : {
"cluster.routing.allocation.enable" : "all"
}
}
POST http://172.16.18.116:9200/_cluster/nodes/elasticsearch_114/_shutdown
GET http://172.16.18.116:9200//logstash-2016.01.07/_segments
POST http://172.16.18.116:9200/_search/scroll?scroll=1m c2NhbjsxOzU3NzIzOmZpVXBnR0VDUl9lRFF3ejBJUjBkOVE7MTt0b3RhbF9oaXRzOjE5OTc2ODs=
https://www.elastic.co/guide/en/elasticsearch/guide/current/_limiting_memory_usage.html#fielddata-size
POST http://172.16.18.116:9200//_cluster/settings
{
"persistent" : {
"indices.fielddata.break.limit" : "80%",
"indices.fielddata.cache.size" : "60%"
}
}
POST http://172.16.18.114:9200//_cache/clear
POST http://172.16.18.114:9200/_optimize?max_num_segments=1
GET http://172.16.18.114:9200/_nodes/hot_threads
PUT http://172.16.18.116:9200/_flush/synced
{
"transient" : {
"cluster.routing.allocation.enable" : "none"
}
}
PUT http://172.16.18.116:9200//_cluster/settings
{
"persistent" : {
"indices.fielddata.break.limit" : "80%",
"indices.fielddata.cache.size" : "60%"
}
}
GET http://172.16.18.179:9200/_cat/segments?v
POST http://172.16.18.116:9200/test_index/_search?search_type=scan&scroll=1m
{
"query": {
"match_all": {}
},
"size": 1000
}
PUT http://172.16.18.116:9200//_cluster/settings
{
"persistent" : {
"indices.store.throttle.type" : "none",
"indices.store.throttle.max_bytes_per_sec" : "100mb",
"indices.fielddata.break.limit" : "80%",
"indices.fielddata.cache.size" : "60%"
}
}
PUT http://172.16.18.114:9201/searchguard/ac/ac
{"acl": [
{
"__Comment__": "Default is to execute all filters",
"filters_bypass": [],
"filters_execute": ["actionrequestfilter.deny"]
},
{
"__Comment__": "This means that every requestor (regardless of the requestors hostname and username) which has the root role can do anything",
"roles": ["root"],
"filters_bypass": ["*"],
"filters_execute": []
},
{
"__Comment__": "172.16.18.171 can do anything",
"hosts": ["172.16.18.171"],
"filters_bypass": ["*"],
"filters_execute": []
},
{
"__Comment__": "172.16.18.114 readonly",
"hosts": ["172.16.18.114"],
"filters_bypass": ["actionrequestfilter.deny"],
"filters_execute": ["actionrequestfilter.readonly"]
},
{
"__Comment__": "172.16.18.114, index: *kibana*, can do anything",
"hosts": ["172.16.18.114"],
"indices": ["*kibana*"],
"filters_bypass": ["*"],
"filters_execute": []
},
{
"__Comment__": "This means that for the user spock on index popstuff only the actionrequestfilter.readonly will be executed, no other",
"users": ["user"],
"indices": ["cdr*"],
"filters_bypass": ["actionrequestfilter.deny"],
"filters_execute": ["actionrequestfilter.readonly"]
}
]}