kibana 笔记

kibana discover URL参数含义

kibana index patten


kibana discover URL含义

kibana discover 使用的查询语法规则是使用Rison

github https://github.com/Nanonid/rison

Rsion playground: rsion.io

kibana URL: http://xdslog.north.shouji.sogou:5601/app/kibana#/discover?_g=(filters:!())&_a=(columns:!(_source),filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'81ad5b70-2d5a-11ea-9358-8336f4938dff',key:domain,negate:!f,params:(query:srv-ad.venus.odin.sogou),type:phrase),query:(match:(domain:(query:srv-ad.venus.odin.sogou,type:phrase))))),index:'81ad5b70-2d5a-11ea-9358-8336f4938dff',interval:auto,query:(language:kuery,query:''),sort:!(!(star_time,desc)))

截取_a参数括号内的值:

1
columns:!(_source),filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'81ad5b70-2d5a-11ea-9358-8336f4938dff',key:domain,negate:!f,params:(query:srv-ad.venus.odin.sogou),type:phrase),query:(match:(domain:(query:srv-ad.venus.odin.sogou,type:phrase))))),index:'81ad5b70-2d5a-11ea-9358-8336f4938dff',interval:auto,query:(language:kuery,query:''),sort:!(!(star_time,desc))

解析后的值为:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
  {
    "columns": [
        "_source"
    ],
    "filters": [
        {
            "$state": {
                "store": "appState"
            },
            "meta": {
                "alias": null,
                "disabled": false,
                "index": "81ad5b70-2d5a-11ea-9358-8336f4938dff",
                "key": "domain",
                "negate": false,
                "params": {
                    "query": "srv-ad.venus.odin.sogou"
                },
                "type": "phrase"
            },
            "query": {
                "match": {
                    "domain": {
                        "query": "srv-ad.venus.odin.sogou",
                        "type": "phrase"
                    }
                }
            }
        }
    ],
    "index": "81ad5b70-2d5a-11ea-9358-8336f4938dff",
    "interval": "auto",
    "query": {
        "language": "kuery",
        "query": ""
    },
    "sort": [
        [
            "star_time",
            "desc"
        ]
    ]
}

查询kibana Index patten

1
2
3
4
5
6
7
8
9
10
11
GET .kibana/_search
{
  "from": 0,
  "size": 50,
  "_source": "index-pattern.title",
  "query": {
    "term": {
      "type": "index-pattern"
    }
  }
}