Questions tagged [date-histogram]

A multi-bucket aggregation similar to the histogram except it can only be applied on date values.

Since dates are represented in elasticsearch internally as long values, it is possible to use the normal histogram on dates as well, though accuracy will be compromised. The reason for this is in the fact that time based intervals are not fixed (think of leap years and on the number of days in a month). For this reason, we need special support for time based data. From a functionality perspective, this histogram supports the same features as the normal histogram. The main difference is that the interval can be specified by date/time expressions.

45 questions
1
vote
0 answers

Date histogram with different Timezones with Elasticsearch v.7.13.3

I have to acquire datas from different part of Timezones (example New York -6.00 and Rome +2.00). In the document I have a field 'timestamp' defined as "data" and I have for example create a "date_histogram" for example from 8.00 AM to 9.00 AM. How…
1
vote
1 answer

Filter on day of the week and aggregate on hour

For my master, I have a programming course in which I have to work with Elasticsearch. I have a dataset with a few million Ubereat orders. Every record consists of the dateTime, restaurant, pickup point and dropoff point. I had to distinguish…
1
vote
0 answers

Elasticsearch date_histogram with interval shows incorrect dates

I use date_histogram aggregation from Elasticsearch with interval of 2d and I also have a filter for one month. eg. from 2019-11-01 to 2019-11-31. I have a mapping like this: PUT test_index/test/_mapping { "properties": { "date": { …
Toe
  • 564
  • 4
  • 11
1
vote
1 answer

Specify bucket key to start from specified value in elastic search(6.7) date histogram

I have a index in elastic search which stores system alerts. This index has values like startTime and endTime of alert.I need to fetch date histogram which specifies the minutely/hourly occurrences of alerts in specified time interval. To fetch I…
puneet_0303
  • 197
  • 1
  • 11
1
vote
1 answer

Let document match multiple buckets of date histogram

I have an index that has a mapping which is similar to { "id": { "type": "long" }, "start": { "type": "date" }, "end": { "type": "date" } } I want to create a date histogram so that each document…
Jonathan R
  • 3,652
  • 3
  • 22
  • 40
1
vote
2 answers

How to group documents by hour without day in elasticsearch?

i have a application who a survey is asked every day by users, and i want to have average answers hours. I tried some request but i can't group all documents by hours, it's grouped by hour by day.. I do this : { "aggs": { "byHour": { …
1
vote
1 answer

Python: Plot month-wise normalised histogram

I have a CSV file with data that look like this: Time Pressure 1/1/2017 0:00 5.8253 ... ... 3/1/2017 0:10 4.2785 4/1/2017 0:20 5.20041 5/1/2017 0:30 4.40774 6/1/2017 0:40 …
Unknown
  • 77
  • 3
  • 12
1
vote
1 answer

Different results between date histogram and date range on Elastic Search

I would like to analyse my logs data with Elastic Search/Kibana and count unique customer by month. Results are different when I use a date histogram aggregation and date range aggregation. Here is the date histogram query : "query": { …
1
vote
2 answers

Is there a faster alternative to "group by" aggregation in Netezza?

This the minimal query statement I want to execute. select count(*) from temper_300_1 group by onegid; I do have "where" clauses to go along as well though. What I am trying to do is build a histogram query and determine the number of elements…
1
vote
1 answer

Elasticsearch Date Histogram Aggregation - get buckets by N count

I need to get from elasticsearch Date Histogram with N buckets. I now that i can get data by interval for example. 1 month - but i need to get date where interval is undefined, but i now te count of buckets - and interval must be calculated by…
Marek
  • 158
  • 2
  • 7
0
votes
1 answer

Problem when group by date and search by date range in Elastic search

I am using elastic search to count data, but I run into an issue that the result of using date histogram and the the result of using date range are different from each other. Here is my query and its result using date histogram and group by date to…
pxq
  • 11
  • 2
0
votes
0 answers

Histogram of time between two date fields in ElasticSearch

I have records in ElasticSearch database where each record has CreatedAt and UpdatedAt fields. I want to generate a histogram of time durations between UpdatedAt and CreatedAt field values. How can I do this? { “Id”: 6002, “customerName”:…
Steve
  • 129
  • 1
  • 14
0
votes
0 answers

Date_histogram aggregation not working in custom expression of anomaly detector feature

I am trying to create an anomaly detector in opensearch, as part of it I am trying to implement date_histogram aggregation under custom expression of feature while creating a model. But when I try to save the feature it throws me the following…
0
votes
1 answer

elastic search count results by day

I have lots of logs in elasticsearch and have to count how many logs I have per one day from last 10 days. Unfortunately my json doesn't work. Could you check where I made mistake? Thanks in advance ! :) I need something like: date :…
0
votes
1 answer

Elasticsearch date_histogram not show full range aggregation

This is my query. I'm using date_histogram with range from Jan - Dec 2021. { "from": 0, "size": 0, "query": { "bool": { "must": [ { "term": { …