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

Can't use scripted field in aggregation #8585

Closed
LeeDr opened this issue Oct 7, 2016 · 2 comments
Closed

Can't use scripted field in aggregation #8585

LeeDr opened this issue Oct 7, 2016 · 2 comments

Comments

@LeeDr
Copy link

LeeDr commented Oct 7, 2016

Kibana version: 5.0.0-rc1 build 3

Elasticsearch version: 5.0.0-rc1 build 3

Server OS version: Elastic Cloud

Browser version: Chrome

Browser OS version: Windows

Original install method (e.g. download page, yum, from source, etc.): Selected 5.0.0-SNAPSHOT on staging-cloud.elastic.co (I'll try to reproduce locally after I get the details into this issue).

Description of the problem including expected versus actual behavior:
On 4.6.1

Steps to reproduce:

  1. Create this index and load 1 doc;
curl -XPUT 'http://admin:notsecure@localhost:9200/test8' -d '{
    "settings" : {
        "number_of_shards" : 1
    }
}'

curl -XPUT 'http://admin:notsecure@localhost:9200/test8/test/1' -d '{
"field1": 100,
"field_name": "field1",
"env": "env1",
"date": "2016-10-05T14:00:00",
"total_counter": 150,
"customer_global_id": "customer1"
}'
  1. Create time-based index pattern for 'test8';
    2016-10-07 11_38_33-ubuntu64 upgraded to 4 6 1 running - oracle vm virtualbox
  2. Create scripted field 'total2x' = doc['total_counter'].value*2;
    2016-10-07 11_41_05-ubuntu64 upgraded to 4 6 1 running - oracle vm virtualbox
  3. Verify the field is visible in Discover and shows the total_counter value * 2;
    2016-10-07 11_42_22-ubuntu64 upgraded to 4 6 1 running - oracle vm virtualbox
  4. Create a Data Table Visualization based on a new search of index pattern 'test8' and change the Metric Aggregation from Count to Average, and then select the scripted field 'total2x'. Split Rows on Date Histogram. On 4.6.1 it works. On 5.0.0-rc1 build 3, the scripted field does not appear in the list;
    2016-10-07 11_45_04-ubuntu64 upgraded to 4 6 1 running - oracle vm virtualbox
  5. Here's a screenshot of the Data Table Visualization Metric list without 'total2x' in it;
    2016-10-07 11_53_41-kibana
  6. I tried in 5.0 using the scripted field as 'expression' and 'painless' with the same results (works in Discover but not in Visualization metric aggregation).
  7. Even if I pick the 'Unique Count' aggregation (which shows Date, Number, and String types) it still does not show the scripted field in 5.0.

Errors in browser console (if relevant): none

Provide logs and/or server output (if relevant):

@LeeDr LeeDr added the P1 label Oct 7, 2016
@LeeDr LeeDr changed the title Cam't use scripted field in aggregation Can't use scripted field in aggregation Oct 7, 2016
@higee
Copy link

higee commented Oct 25, 2016

Hi, how did it go?
Currently, I'm stuck with the same problem as that of yours.
I left similar question on https://discuss.elastic.co/t/visualize-scripted-field/63842 and now waiting for solution.

@Bargs
Copy link
Contributor

Bargs commented Oct 25, 2016

@higee this was a regression that will be fixed in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants