语法:

官方文档

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 safari to search all fields for the term safari.
  • To search for a value in a specific field, prefix the value with the name of the field. For example, you could enter status:200 to find all of the entries that contain the value 200 in the status field.
  • 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 enter status:[400 TO 499].
  • To specify more complex search criteria, you can use the Boolean operators ANDOR, and NOT. For example, to find entries that have 4xx status codes and have an extension of php or html, you could enter status:[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.

转载于:https://www.cnblogs.com/panpanwelcome/p/11281792.html

Kibana Query Language(KQL)相关推荐

  1. Kibana:Kibana Query Language - KQL

    Kibana Query Language (KQL) 是一种使用自由文本搜索或基于字段的搜索过滤 Elasticsearch 数据的简单语法. KQL 仅用于过滤数据,并没有对数据进行排序或聚合的作 ...

  2. Kusto Query Language (KQL) 学习笔记

    Kusto Query Language (KQL) 学习笔记 Kusto 是一种nosql,其有自身的查询语言规则,简称KQL. 学习笔记持续更新中,点击每个节点的小加号,展开小节内容 KQL学习笔 ...

  3. Kibana查询语言(KQL)AND、OR匹配,模糊匹配

    一. 前言 现在大多数的公司都会使用ELK组合来对日志数据的收集.存储和提供查询服务.ElasticSearch + Logstash+ Kibana. 查询数据库,如果是MySQL,那么就需要使用M ...

  4. Kibana查询语言(KQL)

    一.前言 现在大多数的公司都会使用ELK组合来对日志数据的收集.存储和提供查询服务,这里就不介绍什么是ELK了,只介绍一些EKL中的查询,也就是K(kibana). 查询数据库,如果是MySQL,那么 ...

  5. 07--MySQL自学教程:DQL(Data Query Language:数据库查询语言)简介、基础查询、条件查询、模糊查询以及排序(一)

    1. DQL(Data Query Language:数据库查询语言)知识点概览 DQL(Data Query Language:数据库查询语言): 用来查询数据(记录),不会对数据进行改变,而是让数 ...

  6. Hibernate Query Language(HQL)。

    Hibernate Query Language(HQL)提供了十分强大的功能,推荐大家使用这种查询方式.HQL具有与SQL语言类似的语法规范,只不过SQL针对表中字段进行查询,而HQL针对持久化对象 ...

  7. 结构化查询语言(Structured Query Language)

    2019独角兽企业重金招聘Python工程师标准>>> 结构化查询语言(Structured Query Language)简称SQL(发音:/ˈɛs kjuː ˈɛl/ " ...

  8. Oracle结构化查询语言(Structured Query Language)

    SQL是结构化查询语言(Structured Query Language) 专门用于数据存取.数据更新及数据库管理等操作. 此文后积累学习用SQL语句对数据库的表进行增删改查的操作. 在Oracle ...

  9. M001: MongoDB Basics Chapter 3: Deeper Dive on the MongoDB Query Language学习记录

    M001: MongoDB Basics Chapter 3: Deeper Dive on the MongoDB Query Language学习记录 运行环境 操作系统:windows 10 家 ...

最新文章

  1. [register]-05-ARMv8中常用系统寄存器详解
  2. VC++动态链接库编程(转载)
  3. Spark性能优化的10大问题及其解决方案
  4. Mysql-5.5+Heartbeat-3.0.5+DRBD
  5. 解决新电脑的系统安装问题:针对BIOS的UEFI模式
  6. android fota解决方案,Android智能终端FOTA方案的制作方法
  7. 计算机毕业设计:java基于SSM的班级管理系统
  8. QQ2007密码盗取程序介绍(参考部分网上代码)
  9. django mysql内存泄漏_Django ORM性能优化,数据存取优化
  10. Arduino + W5100调试笔记(1)
  11. TCP/IP协议各层的网络设备
  12. 天翼云流量服务器,天翼云CDN常见问题解答
  13. AHRS系统的基本构成
  14. Kotlin 协程与flow
  15. 【Spring Boot教程】(七):自定义项目启动的彩蛋
  16. VNC树莓派无法连接
  17. 计算机二级没考过考计算机三级,怎么样才能学好计算机二级,考了两次还没有过啊...
  18. 立创EDA仿真入门1 基本操作
  19. muse-ui.css_Muse UI:适用于Vuejs 2.0的Material Design UI库
  20. Mybatis之高级映射【一对多映射】

热门文章

  1. python如何赋值给元组_【Python 1-9】Python手把手教程之——元组和元组的使用技巧...
  2. MFC 分割窗体(Splitter Windows)
  3. UI设计教程分享:PS故障风海报制作教程
  4. spark-3.1.2兼容多版本hive
  5. 计算机学院认知实习报告
  6. 重庆大学计算机科学与工程学院,何中市
  7. ajax从服务器获取图片,JQuery ajax与POST从CORS启用服务器获取图像/ png
  8. 学习笔记5-知识点【卷积计算,dim,超参数,torch.zeros,gamma,beta,eps,assert,优化器,groups,// 和/,reshape,isinstance,hasattr
  9. canvas坐标转换屏幕坐标_Canvas坐标系转换
  10. VB-Excel编程经历*