Kibana Query Language(KQL)
语法:
If you’re familiar with Kibana’s old lucene query syntax, you should feel right at home with the new syntax. The basics stay the same, we’ve simply refined things to make the query language easier to use. Read about the changes below.
response:200 will match documents where the response field matches the value 200.
Quotes around a search term will initiate a phrase search. For example, message:"Quick brown fox" will search for the phrase "quick brown fox" in the message field. Without the quotes, your query will get broken down into tokens via the message field’s configured analyzer and will match documents that contain those tokens, regardless of the order in which they appear. This means documents with "quick brown fox" will match, but so will "quick fox brown". Remember to use quotes if you want to search for a phrase.
The query parser will no longer split on whitespace. Multiple search terms must be separated by explicit boolean operators. Note that boolean operators are not case sensitive.
response:200 extension:php in lucene would become response:200 and extension:php. This will match documents where response matches 200 and extension matches php.
We can make terms optional by using or.
response:200 or extension:php will match documents where response matches 200, extension matches php, or both.
By default, and has a higher precedence than or.
response:200 and extension:php or extension:css will match documents where response is 200 and extension is php OR documents where extension is css and response is anything.
We can override the default precedence with grouping.
response:200 and (extension:php or extension:css) will match documents where response is 200 and extension is either php or css.
A shorthand exists that allows us to easily search a single field for multiple values.
response:(200 or 404) searches for docs where the response field matches 200 or 404. We can also search for docs with multi-value fields that contain a list of terms, for example: tags:(success and info and security)
Terms can be inverted by prefixing them with not.
not response:200 will match all documents where response is not 200.
Entire groups can also be inverted.
response:200 and not (extension:php or extension:css)
Ranges are similar to lucene with a small syntactical difference.
Instead of bytes:>1000, we omit the colon: bytes > 1000.
>, >=, <, <= are all valid range operators.
Exist queries are simple and do not require a special operator. response:* will find all docs where the response field exists.
Wildcard queries are available. machine.os:win* would match docs where the machine.os field starts with "win", which would match values like "windows 7" and "windows 10".
Wildcards also allow us to search multiple fields at once. This can come in handy when you have both text and keyword versions of a field. Let’s say we have machine.os and machine.os.keyword fields and we want to check both for the term "windows 10". We can do it like this: `machine.os*:windows 10".
Terms without fields will be matched against the default field in your index settings. If a default field is not set these terms will be matched against all fields. For example, a query for response:200 will search for the value 200 in the response field, but a query for just 200 will search for 200 across all fields in your index.
Lucene Query Syntax
Kibana’s legacy query language was based on the Lucene query syntax. For the time being this syntax is still available under the options menu in the Query Bar and in Advanced Settings.
The following are some tips that can help get you started.
- To perform a free text search, simply enter a text string. For example, if you’re searching web server logs, you could enter
safarito search all fields for the termsafari. - To search for a value in a specific field, prefix the value with the name of the field. For example, you could enter
status:200to find all of the entries that contain the value200in thestatusfield. - To search for a range of values, you can use the bracketed range syntax,
[START_VALUE TO END_VALUE]. For example, to find entries that have 4xx status codes, you could enterstatus:[400 TO 499]. - To specify more complex search criteria, you can use the Boolean operators
AND,OR, andNOT. For example, to find entries that have 4xx status codes and have an extension ofphporhtml, you could enterstatus:[400 TO 499] AND (extension:php OR extension:html).
For more detailed information about the Lucene query syntax, see the Query String Query docs.
These examples use the Lucene query syntax. When lucene is selected as your query language you can also submit queries using the Elasticsearch Query DSL.
Kibana Query Language(KQL)的更多相关文章
- Kibana查询语言(KQL)
一.前言 现在大多数的公司都会使用ELK组合来对日志数据的收集.存储和提供查询服务,这里就不介绍什么是ELK了,只介绍一些EKL中的查询,也就是K(kibana). 查询数据库,如果是MySQL,那么 ...
- hql(Hibernate Query Language)
1.Criteria查询对查询条件进行了面向对象封装,符合编程人员的思维方式,不过HQL(Hibernate Query Language)查询提供了更加丰富的和灵活的查询特性,因此Hibernate ...
- HQL: The Hibernate Query Language
Chapter 14. HQL: The Hibernate Query Language 14.1. Case Sensitivity 14.2. The from clause 14.3. Ass ...
- SQL Structured Query Language(结构化查询语言) 数据库
SQL是Structured Query Language(结构化查询语言)的缩写. SQL是专为数据库而建立的操作命令集,是一种功能齐全的数据库语言. 在使用它时,只需要发出“做什么”的命令,“怎么 ...
- Hibernate Query Language查询:
Hibernate Query Language查询: Criteria查询对查询条件进行了面向对象封装,符合编程人员的思维方式,不过HQL(Hibernate Query Language)查询提供 ...
- GraphQuery - Powerful html/xml query language
GraphQuery GraphQuery is a query language and execution engine tied to any backend service. It is ba ...
- 数据库原理及应用-用户接口及SQL查询语言(Query Language)
2018-02-07 20:41:39 一.DBMS的用户接口 查询语言 访问DBMS的访问工具(GUI) API 相关类库 二.SQL语言 SQL语言可以细分为四种: 1.Data Definiti ...
- JDBC(Java Database Connectivity,Java数据库连接)API是一个标准SQL(Structured Query Language
JDBC(Java Database Connectivity,Java数据库连接)API是一个标准SQL(Structured Query Language,结构化查询语言)数据库访问接口,它使数据 ...
- 数据库系统概述(Data Model、DBMS、DBS、RDBS、Structured Query Language)
数据Data 描述事物的符号记录成为数据. 数据是数据库中存储的基本对象. 除了基本的数字之外.像图书的名称.价格.作者都可以称为数据. 将多种数据记录列成一张表.通过数据表管理数据. 每一行的数 ...
随机推荐
- Kubernetes的核心技术概念和API对象
Kubernetes的核心技术概念和API对象 API对象是K8s集群中的管理操作单元.K8s集群系统每支持一项新功能,引入一项新技术,一定会新引入对应的API对象,支持对该功能的管理操作.例如副本集 ...
- sk_buff内核api函数记录
1.alloc_skb() 上层协议要发送数据包的时候或网络设备准备接收数据包的时候调用 2.kfree_skb() 释放sk_buff结构体 3.skb_put() 在数据区的末端添加某协议的尾部 ...
- python3 pyinstaller
一.安装python.pywin32.pyinstaller库 二.官网:https://pyinstaller.readthedocs.io/en/v3.3.1/usage.html#general ...
- 0008SpringBoot中的spring.config.location对于运维的用处
在工作过程中,若项目已经打好包,application.properties中的配置文件已经不能修改,但是还是需要修改一些参数或者新增一些参数的情况下怎么办? 可以单独再定义一个配置文件,比如定义名称 ...
- Postman----登录接口返回的reponse中token值传递给其他接口的一个简单接口测试示例
注: 在进行接口测试时,我们都需要使用登录,并且其他的接口都要在登录后进行,那么必不可少的会使用到将登录接口的reponse返回结果中的某些参数值需要进行返回,并传递给其他接口,这样才可以进行登录后的 ...
- selenium怎样避免被服务器检测
selenium是用来完成浏览器自动化相关的操作.可以通过代码的形式制定一些基于浏览器自动化的相关操作(行为动作),当代码执行后,浏览器就会自动触发相关的事件.但这并不能避免服务器的检测.当在浏览器中 ...
- django中非菜单权限的归属
非菜单权限的归属 : 1.设置表结构 : 在权限表中添加自连接的外键patent,parent_id连接permission表的id,可为空,当有parent_id时,说明它是一个普通 ...
- Verilog Tricks
1,可用generate产生512*FIFO 2,Vivado的warning也要全部排除 3,小module测完再往大module加 4,复位和IDLE处的置零操作一定要写全了 5,设计通信接收机时 ...
- 018_STM32程序移植之_串口接收中文
(一)在平时数据传输中很少用到接收中文的情况,但是最近需要用到就花了半天时间来弄弄 (二)接收原理,从现在接收情况分析:一个中文占两个数据的空间,也就是两个十六进制可以转化成为一个中文 (三)示例情况 ...
- 005_linux驱动之_class_device_create函数
(一)解析class_device_create函数 (二)当我们使用class_create创建一个类之后我们就可以使用class_device_create函数在这个类下面创建一个设备了,cl ...