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

Support Aggregation on Date #3851

Closed
kadaan opened this issue May 15, 2015 · 1 comment
Closed

Support Aggregation on Date #3851

kadaan opened this issue May 15, 2015 · 1 comment

Comments

@kadaan
Copy link

kadaan commented May 15, 2015

Kibana doesn't support aggregations by date fields even though Elasticsearch support it. In the objects page, the visualization can be changed to allow aggregation by date, but Kibana does use the value_as_string field in the response. For example, for the following aggregate:

{
   ...,
    "aggs": {
        "2": {
            "terms": {
                "field": "host",
                "size": 1000,
                "order": {
                    "1": "desc"
                }
            },
            "aggs": {
                "1": {
                    "max": {
                        "field": "@timestamp"
                    }
                }
            }
        }
    },
   ...
}

The following response is returned:

{
   ...,
   "aggregations" : {
       "2" : {
            "doc_count_error_upper_bound" : 0,
            "sum_other_doc_count" : 0,
            "buckets" : [
                {
                    "1" : {
                        "value" : 1431649893353,
                        "value_as_string" : "2015-05-15T00:31:33.353Z"
                    },
                    "key" : "SERVER",
                    "doc_count" : 34278
                }
            ]
        }
    },
    ...
}

The result in Kibana as a datagrid is:
image

Please enable both support for aggregations on date and choosing to use the value_as_string for display.

@rashidkpc
Copy link
Contributor

Both of these issues have been fixed in master for some time.

  1. Fix/3286 #3369
  2. Field formatting #2731

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

No branches or pull requests

2 participants