-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kql, lucene and timerange functions #93043
kql, lucene and timerange functions #93043
Conversation
Pinging @elastic/kibana-app-services (Team:AppServices) |
@elasticmachine merge upstream |
566aac0
to
ad76bb3
Compare
@elasticmachine merge upstream |
4873635
to
07373da
Compare
d6c41d3
to
3de7093
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked in Chrome/Mac, LGTM. Dashboards work as expected and checked the new functions in the expression sample plugin, both work.
@@ -61,7 +63,7 @@ export const kibanaContextFunction: ExpressionFunctionKibanaContext = { | |||
}), | |||
}, | |||
timeRange: { | |||
types: ['string', 'null'], | |||
types: ['timerange', 'null'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess these two type changes are breaking changes, so we need a breaking change note.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as we never store the expression (except in canvas), nor expose expression to the user (except in canvas) and this function is not used in canvas I think we are good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this works fully as intended. I tested Visualize with a KQL query and it's serialized to a lucene
expression function:
Pretty sure it's caused by this line: https://github.com/elastic/kibana/pull/93043/files#diff-329955dd8d6110b5e8c0eaf934dd0ce1f3357dfd682b43a19652e8274cc916efR15
language
is actually kuery
, not kql
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this PR and if a kql query is added to a visualization, it won't be applied on dashboard:
- Go to visualize, create metric vis and add
geo.src: "CN"
kql query - Save
- Filter is not part of the request on the dashboard (and count is wrong)
It's part of the ast though
7020ef5
to
0425a5a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Visualize changes LGTM, work as expected for kql and lucene
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
Co-authored-by: Kibana Machine <[email protected]>
Summary
This PR adds
kql
,lucene
andtimerange
expression functions as well asqueryToAst
andtimerangeToAst
helper functions and makes the use of them inkibana_context
expression functionresolves #67895
Checklist
Delete any items that are not applicable to this PR.
For maintainers