Introduce simple kibana query language#15646
Conversation
Bargs
left a comment
There was a problem hiding this comment.
Seems to work well! I love how little code this took. Left a couple nitpick comments but that's it.
Do you think we should call it anything other than simpleKuery? Down the road I think this simple language and the advanced language will have little connection with one another syntactically so it might be confusing to call them by similar names.
| export function buildQueryFromKuery(indexPattern, queries) { | ||
| const queryASTs = _.map(queries, query => fromKueryExpression(query.query)); | ||
| export function buildQueryFromKuery(indexPattern, queries, useSimple = false) { | ||
| const queryASTs = _.map(queries, query => fromKueryExpression(query.query, undefined, useSimple)); |
There was a problem hiding this comment.
I think a separate from_simple_kuery.js module might be more clear than passing around a boolean flag, even if it duplicates a little code.
| </div> | ||
| </div> | ||
|
|
||
| <!-- kuery input --> |
src/ui/public/kuery/ast/ast.js
Outdated
| const simpleKueryParser = PEG.buildParser(simpleGrammar); | ||
|
|
||
| export function fromKueryExpression(expression, parseOptions = {}) { | ||
| export function fromKueryExpression(expression, parseOptions = {}, useSimpleParser = false) { |
There was a problem hiding this comment.
Similar to the comment above, I think a separate fromSimpleKueryExpression function would be more clear than a boolean flag here.
|
LGTM! |
* Introduce simple kuery language * Rename to kql and add modules
|
6.x (6.2.0): 13246b3 |
This reverts commit f593adc.
Closes #15642.
This introduces an experimental, invisible simple language extracted from the Kuery language. The purpose of this is to have something we can iteratively add new features to without affecting the general Kibana interface.
To use it, you need to go in the URL bar and change the
languageattribute tokql.