Find unique hours from date field

I have time-stamp field (yyyy-mm-dd T hh:mm:ss). I want to count how many different hours are present in given day. How to do that in kibana ?

For example.
Doc1=
{
name="heart_beat"
date="2019-06-05 T 12:10:00"
}
Doc2=
{
name="heart_beat"
date="2019-06-05 T 09:10:00"
}
Doc3=
{
name="heart_beat"
date="2019-06-05 T 12:15:00"
}
Doc4=
{
name="heart_beat"
date="2019-06-05 T 07:10:00"
}

So answer will be 3

07,09 and 12

for doing that you'd want to have a day/date and a hour field in your document (either from ingest, either via scripted fields), then you would have a cardinality metric on the hour field, with the date field in as the X-axis in your histogram.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.