-
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
Support Bucket Script Aggregation #4707
Comments
Duplicate #4584 |
@rashidkpc I don't see how this is a dupe of the pipelines stuff. The pipelines in in 5.4 but I don't see bucket script aggregations there. Can we re-open this? |
I'm interested in this feature in order to do visualizations of values on documents that represent farmers fields where I need to weight the values greater for large fields and smaller for small fields, after the search query has selected the field documents to be included in the weighted average. The bucket_script feature seems to be the answer (I have it working in elasticsearch) but I can't seem to reproduce such a query when using a Kibana visualization. Are there any plans to support this soon? Or is there any workaround? (e.g. I was trying to see if I can directly tell Kibana the elasticsearch query I want used for a visualization instead of Kibana creating the query for me based on my UI choices - but that doesn't seem to be possible? Is that correct?) |
+1 |
I would be interested in this functionality. In our use case, it would allow to work around with success/failure ratios. |
+1 would like to see this as well! Should be pretty simple to implement.. Just a "Custom Metric" in the Dropdown which presents a box where you can input your aggregation JSON.. |
Starting with Kibana 5.4, bucket script agg is now supported in Time Series Visual Builder, though it's called "Calculation" (cc @simianhacker I wonder if we should make it more explicit that this option relies on "Bucket Script"?) Could folks on this ticket (e.g. @Kazark) give it a try and let us know if it helps in your use cases? |
I think @simianhacker has agreed that it makes sense to rename this aggregation. I've opened #13796 for tracking purposes. |
@tbragin Having the bucket script aggregation in the TSVB is a very nice feature, imo - thanks a lot for implementing it. The things which I tried worked very well. Nevertheless it would be great if the TSVB supported additional script aggregations (e.g. scripted sum aggregation), as the bucket script aggregation can only fully leverage its potential, if all kinds of sub-aggregations are supported. But since this is not a place to discuss this in more detail, I have opened another issue. |
Is there a timeline for this feature? |
The 'Calculate' feature can only do a bucket-script as a top-level, it can't be applied within a parent bucket-aggregation... :( And that's only in the time-series visualization, there's no bucket-script in the standard visualizations. Our particular use-cases require both, and it seems like none are supported - not even in 6.x(rc) In our use-cases, each document has a start-time and end-time date-type fields, and we need to generate an overall-duration across buckets of those, grouped on some category-field. An almost identical structure has been detailed here: https://discuss.elastic.co/t/kibana-5-4-bucket-script-visualization/86475 I was able to express that in the query-DSL, and we're using it in production already - but we can't visualize these in Kibana - which REALLY sucks, as our clients have been requesting such visualizations for years, and we've always told them 'we need support from later versions, for pipeline-aggregations'... Is there a workaround using some "advanced JSON" thing I can put my query-DSL in there? |
Just adding my use case as requested in this question:
I really hope this will be implemented, as this is a definitive showstopper for us. |
Please just add "Bucket Script Aggregation" or "Custom Aggregation" as an option in the normal visualizations.. Should be easy, just like the other aggregation but without adding any content in the aggregation body (just the json supplied by the user) |
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
One use case for this feature is to workaround Elasticsearch not having a non-negative option for derivative aggregation so that charts can end up showing negative derivative values (upon intentional server restarts): elastic/elasticsearch#15542 |
+1 |
This is a much requested feature from users, similar to #17544. Are there any plans to implement this? |
Would be nice ! |
+1 |
1 similar comment
+1 |
I'm late to this party, so my disappointment is fresh. A few days ago, I created the Elastic discussion forum topic "Visualize a value calculated from the per-bucket sum of one field divided by the per-bucket sum of another?" (sorry about the verbose title). Soon after, I found this issue, and belatedly realized why I couldn't figure out how to do that in "standard" Kibana visualizations I replied to my own forum topic, citing this issue, and showing basic examples of using bucket scripts in TSVB and—I guess this is why I'm posting this comment, in case it's helpful to anyone—Vega-Lite. |
Waiting this wanted feature, an alternative for data table visualization is to use « enhanced table » community plugin, and its « computed columns » feature: |
Kibana is useless at the moment because there is no way to do any kind of post processing of an aggregated field value. I've lost 2 days trying to figure out a work-around only to find that any and all ways to do this (bucket_script, scripted_fields, weighted average, etc.) are seemingly blocked by Kibana intentionally. Now we have to find a new tool and move away from Kibana, which most likely means the entire Elk stack. Is there a technical limitation here? This thread is 6 years old, either the development team doesn't care about those that actually use this tool, or there's some good reason that isn't communicated to its users very well. It seems silly that Kibana can't display what Elasticsearch is capable of. Even just a visualization tool for advanced users where you can just input you query and get a data table result from its results should be provided if the easy to use tools have some kind of limitation in this area. A sad good-bye to a tool I was really liking but spent way too long defending |
We are also on the same line of thinking. Kibana can't be used as a visualization tool, it's more like a log analyzing tool. |
#4707 (comment) works for me so far. What is your use case in that they don’t work? |
@jmottster
|
Yes, thank you for providing this info, however it doesn't meet my particular needs, which is to have these aggregation features available in a data table output format. Graphs are not the problem. |
If you want a table output, there are several ways:
And yes, I created this community plugin ;) |
I've entertained all the options, SQL is not an option, that's why we were using Elasticsearch in the first place, so as not to overload the main databases. I certainly appreciate suggestions, but I've been through all of them. I'm not here for that, I'm here to say this should be a available in all visualizations, we shouldn't have to search for work-arounds to visualize (graph or table) data in Kibana when we're using out-of-the-box Elasticsearch features for our queries. It makes no sense that there are restrictions, and every time someone points them out, the response is just a list of inconvenient work-arounds rather than any information on why these features are missing or if/when they will be implemented. If the reason were shared, perhaps there'd be less frustration -- which I see everywhere I find this subject discussed -- and more patience. I would have loved to try out your plugin, btw, as I had found it. But our deployment environment was Elastic Cloud, (which isn't cheap, thus my frustrations), and has its own limitations like not being able to install plugins, |
Sorry that you can’t use enhanced table plugin... Concerning SQL, I want to say “a SQL query to Elasticsearch”, not to a SQL database. Because yes, you can query Elasticsearch using SQL. Finally, I fully agree with you that bucket script should be available in all visualizations, I would love that. And so, I share your frustration. |
Closing this because it's not planned to be resolved in the foreseeable future. It will be tracked in our Icebox and will be re-opened if our priorities change. Feel free to re-open if you think it should be melted sooner. |
Given the rhe new Bucket Script Aggregation, we can implement formulas from aggregated metric values (e.g.
metric1 / metric2 * 100
). This would allow calculation of e.g. ratio between two metric results.https://www.elastic.co/guide/en/elasticsearch/reference/master/search-aggregations-pipeline-bucket-script-aggregation.html
Usage Scenario:
Links to: #3505
The text was updated successfully, but these errors were encountered: