Skip to content

Introduce simple kibana query language#15646

Merged
lukasolson merged 3 commits intoelastic:masterfrom
lukasolson:simpleKuery
Jan 5, 2018
Merged

Introduce simple kibana query language#15646
lukasolson merged 3 commits intoelastic:masterfrom
lukasolson:simpleKuery

Conversation

@lukasolson
Copy link
Contributor

@lukasolson lukasolson commented Dec 15, 2017

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 language attribute to kql.

@lukasolson lukasolson self-assigned this Dec 15, 2017
@lukasolson lukasolson requested a review from Bargs December 15, 2017 23:29
Copy link
Contributor

@Bargs Bargs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simple kuery input?

const simpleKueryParser = PEG.buildParser(simpleGrammar);

export function fromKueryExpression(expression, parseOptions = {}) {
export function fromKueryExpression(expression, parseOptions = {}, useSimpleParser = false) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the comment above, I think a separate fromSimpleKueryExpression function would be more clear than a boolean flag here.

@lukasolson lukasolson mentioned this pull request Jan 4, 2018
6 tasks
@Bargs
Copy link
Contributor

Bargs commented Jan 5, 2018

LGTM!

@lukasolson lukasolson changed the title Introduce simple kuery language Introduce simple kibana query language Jan 5, 2018
@lukasolson lukasolson merged commit f593adc into elastic:master Jan 5, 2018
lukasolson added a commit that referenced this pull request Jan 5, 2018
* Introduce simple kuery language

* Rename to kql and add modules
@lukasolson
Copy link
Contributor Author

6.x (6.2.0): 13246b3

epixa added a commit to epixa/kibana that referenced this pull request Jan 7, 2018
@lukasolson lukasolson deleted the simpleKuery branch March 27, 2018 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants