Kibana histogram with a value to zero
Hi, I can't figure out how to display a value that is 0 ( zero ) in an histogram . When i do my request i have this : { "took" : 5, "timed_out" : false, "_shards" : { "total" : 5, "successful" : 5, "failed" : 0 }, "hits" : { "total" : 191, "max_score" : 0, "hits" : [ ] }, "facets" : { "0" : { "_type" : "date_histogram", "entries" : [ { "time" : 1412072076000, "count" : 1, "min" : 0, "max" : 0, "total" : 0, "total_count" : 1, "mean" : 0 }, { "time" : 141207208, "count" : 2, "min" : 2, "max" : 2, "total" : 2, "total_count" : 1, "mean" : 2 }, { "time" : 141207217, "count" : 1, "min" : 0, "max" : 0, "total" : 0, "total_count" : 1, "mean" : 0 }, { "time" : 1412079637000, "count" : 1, "min" : 15, "max" : 15, "total" : 15, "total_count" : 1, "mean" : 15 }, { As you see i have some entries with value max = 0 , but i cant' see them in the histogram i only see values > or < to zero . I tried the "zero fill" options but it render weirds , it had a zero point near every other points . Any help will be really appreciated , thanks -- You received this message because you are subscribed to the Google Groups "elasticsearch" group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/73f2e61e-660b-4c46-9628-a6f4ef8c7457%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: date_historgram facet issue
Just for helping someone if needed , this could be done using aggregations of ES 1.x like this { "size": 0, "query": { "filtered": { "query": { "match_all": {} } } }, "aggs": { "nest_global": { "nested": { "path": "periods" }, "aggs": { "stat2": { "stats": { "field": "duration" } } } }, "par_date": { "date_histogram": { "field": "date", "interval": "day" }, "aggs": { "nest_par_date": { "nested": { "path": "periods" }, "aggs": { "stat2": { "stats": { "field": "duration" } } } } } } } } Thanks to Erwan D from Elastic French Group ! Le mardi 4 février 2014 11:06:56 UTC+1, Samuel Merlet a écrit : > > Hi > i have some documents like this > > { > date : "2014-01-01", > "periods" : { > { "start" : 0 , "duration": 55 }, > { "start" : 1 , "duration": 55 }, > > { "start" : 2 , "duration": 55 }, > > { "start" : 3 , "duration": 55 }, > > etc... > } > } > > > > I do a query on a date range with a statistical facet to get the sum of > all duration > > > { > "query": { > "filtered": { > "query": { > "match_all": {} > }, > "filter": { > "range": { > "date": { > "gte": "2014-01-01", > "lte": "2014-01-11" > } > } > } > } > }, > "facets": { > "stat1": { > "statistical": { > "field": "duration" > }, > "nested": "periods" > } > } > } > > > this works perfect . > Now i need to get the sum of duration for each day , so i tried by using > the date_historgram , but i have no luck with it ( i guess because my > periods is a nested object ) > > > here is my try > > { > "query": { > "filtered": { > "query": { > "match_all": {} > }, > "filter": { > "range": { > "date": { > "gte": "2013-01-10", > "lte": "2013-01-11" > } > } > } > } > }, > "facets": { > "stat1": { > "statistical": { > "field": "duration" > }, > "nested": "periods" > }, > "stat2": { > "date_histogram": { > "key_field": "date", > "value_field": "duration", > "interval": "day" > }, > "nested": "periods" > } > } > } > > > Anyone can help me on this ? Thanks > > -- You received this message because you are subscribed to the Google Groups "elasticsearch" group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/a58ae6f1-1fa4-43d5-b62a-4c6dd436b2d5%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
date_historgram facet issue
Hi i have some documents like this { date : "2014-01-01", "periods" : { { "start" : 0 , "duration": 55 }, { "start" : 1 , "duration": 55 }, { "start" : 2 , "duration": 55 }, { "start" : 3 , "duration": 55 }, etc... } } I do a query on a date range with a statistical facet to get the sum of all duration { "query": { "filtered": { "query": { "match_all": {} }, "filter": { "range": { "date": { "gte": "2014-01-01", "lte": "2014-01-11" } } } } }, "facets": { "stat1": { "statistical": { "field": "duration" }, "nested": "periods" } } } this works perfect . Now i need to get the sum of duration for each day , so i tried by using the date_historgram , but i have no luck with it ( i guess because my periods is a nested object ) here is my try { "query": { "filtered": { "query": { "match_all": {} }, "filter": { "range": { "date": { "gte": "2013-01-10", "lte": "2013-01-11" } } } } }, "facets": { "stat1": { "statistical": { "field": "duration" }, "nested": "periods" }, "stat2": { "date_histogram": { "key_field": "date", "value_field": "duration", "interval": "day" }, "nested": "periods" } } } Anyone can help me on this ? Thanks -- You received this message because you are subscribed to the Google Groups "elasticsearch" group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/3a65022d-1787-4d1a-aaca-d0f493f54070%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Design help
Hello, I have a question related to data/application design . I want to use elasticsearch to get some statistics , we currently use MySQL but we have serious performance issues , i really think ES can help us. I have a table that record some event of operators login and logout . It looks like this ID I operator I event I datetime -- 12 I 4587 I login I 2014-01-20 10:15:10 12 I 4581 I login I 2014-01-20 12:15:10 12 I 4587 I logout I 2014-01-20 13:15:10 from this i need to provide some stats like for exemple : for a given day/week/month how much time do have a least 1 operator online for a given day/week/month how much operator are online at the same time then i need for exemple a granularity hour per hour i currently fetch some data from mysql and compute my stats using php , but we talk here about millions of entries i and i expect to get much more in few months , so i need something fast . So my questions are , does ES can be usefull if i store my data as it , does ES provide the necessary tools to make some stats without having to compute after fetching the datas . Do i have to compute some data before storing in ES ( for exemple calculate for each hour of the day and store each hour as a document ) i would love to hear from you if you already have such a case , or if you have some ideas . ( if it's not the good place for such a discussion where can i post it ? ) Thanks -- You received this message because you are subscribed to the Google Groups "elasticsearch" group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/e01aa314-3d1f-4286-9283-0b3f22b7b171%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.