Skip to content
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

[TSVB] Disable using top_hits in bucket script aggregations #44294

Closed
kakulukia opened this issue Aug 28, 2019 · 10 comments · Fixed by #82278
Closed

[TSVB] Disable using top_hits in bucket script aggregations #44294

kakulukia opened this issue Aug 28, 2019 · 10 comments · Fixed by #82278
Assignees
Labels
Feature:TSVB TSVB (Time Series Visual Builder) good first issue low hanging fruit Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@kakulukia
Copy link

Kibana version: 7.0.1

Elasticsearch version: 7.0.1

Server OS version: CentOS 7

Browser version: Crome Version 75.0.3770.90 (Offizieller Build) (64-Bit)

Browser OS version: Windows Server 2016 Standard

Original install method (e.g. download page, yum, from source, etc.): openstack docker image

Describe the bug:

buckets_path must reference either a number value or a single value numeric metric aggregation, got: org.elasticsearch.search.aggregations.bucket.filter.InternalFilter

This happens while designing a Gauge in the Visual Builder using two TopHit aggregations as a source for two Bucket Script variables.

The bucket script shall only do a simple thing "params.var1 / params.var2" but produces the above error.

Steps to reproduce:

  1. Open Visual Builder
  2. Create a new Visualisation and switch to Gauge
  3. Create to TopHit aggregations of to vars from the same index
  4. Add a bucket script using those vars like "params.var1 / params.var2"
  5. The preview should now feature the same error as shown above.

Expected behavior:
I dont think i fully understand Elastic/Kibana already and all of its terms, but to my understanding im only using two "single value numeric metric aggregation"s to try to have a dynamic gauge. So this according to some tutorial page i found should give me a working gauge.

@wylieconlon wylieconlon added Feature:TSVB TSVB (Time Series Visual Builder) Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Aug 28, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app

@wylieconlon
Copy link
Contributor

I can confirm that this is happening in all the TSVB visualizations, not just Gauge. I'm going to change the title to be more descriptive of what I think is happening here.

@wylieconlon wylieconlon changed the title VisualBuilder Gauge issue [TSVB] Can't create bucket script for top_hits Aug 28, 2019
@wylieconlon
Copy link
Contributor

Screenshot 2019-08-28 16 20 59

@timroes
Copy link
Contributor

timroes commented Aug 30, 2019

@alexwizp It looks like bucket script just doesn't work with Top Hits aggregations together. Maybe we could prevent the params selection in the bucket script to select that kind of aggregations, and instead disable them in the "Variables" view of Bucket Script?

@kakulukia
Copy link
Author

That would render me unable to complete my goal of having a dynamic gauge displaying the latest values. Is there an alternative to the bucket script?

@timroes timroes added the good first issue low hanging fruit label Sep 24, 2019
@dchoa
Copy link

dchoa commented Oct 25, 2019

Hi all, do we have a fix on this bug yet?
I meet an issue that may be the same. I'm using time series instead of gause, and it just shows nothing on graph.
I'm using ELK stack version 7.2.
Thanks.

@DeeeFOX
Copy link

DeeeFOX commented Nov 19, 2019

hi, i'am watching this issue. I want to get the result in a buckets script using: "top_hits[0] - top_hits[1]"

@Erni
Copy link

Erni commented Mar 11, 2020

Why there is no Scripted Metric Aggregation in the Aggregation list? I think this would avoid (or reduce) the need of having to use the Top Hits aggregation just for retrieving values to use later in a Bucket Script.

@tylersmalley
Copy link
Contributor

@timroes, do you know if there is a workaround?

@timroes timroes changed the title [TSVB] Can't create bucket script for top_hits [TSVB] Disable using top_hits in bucket script aggregations Mar 17, 2020
@timroes
Copy link
Contributor

timroes commented Mar 17, 2020

Scripted Metric Aggregation doesn't appear in the list, because it's not implemented in TSVB (or any other place in Kibana). You can check a matrix of supported aggregations in #58628 and support for scripted metric aggregations are tracked in #2646.

For clarification: this issue tracks that we make it impossible in the TSVB UI to use top_hits inside the bucket_script aggregation, because they do not work from Elasticsearch side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:TSVB TSVB (Time Series Visual Builder) good first issue low hanging fruit Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants