elasticsearch kabana中创建索引

时间:2024-12-13 12:06:38

在kabana中创建索引和索引类型语法

PUT clockin
{
"mappings": {
"time": {

}
}
}

查询索引下的所有数据

GET clockin/_search
{
"query": {
"match_all": {}
}
}

删除索引

DELETE clockin

通过uuid查询和时间倒序查询

GET test/_search
{
"query": {
"bool": {
"must": [
{
"match": {
"uuid": "050058"
}
}
]
}
},
"sort": {
"time": {
"order": "desc"
}
},
"size": 1000
}

//通过时间段查询和时间倒序排序

GET test/_search
{
"query": {
"bool": {
"must": [{
"range": {
"time": {
"gte": "2018-09-14T07:00:00",
"lte": "2018-09-14T23:30:00"
}
}
}]

}
},
"sort": {
"time": {
"order": "desc"
}
},

"size": 10000
}

elasticsearch kabana中创建索引elasticsearch kabana中创建索引

fileddata 在text默认编辑字段上被禁用的需要手动开启

exceptin 是index       log是type

PUT exception/_mapping/log
{
"properties":{
"time":{
"type":"text",
"fielddata":true
}
}
}

相关文章