Visualize day between two dates on kibana

(timpamungkas) #1

I have date with following fields

    branch_id: 909
    agent_id: 909A01234
    first_call_date: date A, can be empty (no call made yet)
    final_call_date: date B, can be empty (no call made yet)

I want to visualize min, max, and average(days between first_call_date and final_call_date, group by branch. I'm thinking of having line chart where x axis is branch_id. The question is: how can I calculate days between those two days? I don't see any math function during visualization creation.

Thank you

(Bhavya R M) #2


You can use scripted fields here. Write a script to calculate the days between those two days - add it to a field and use that in visualization.


(timpamungkas) #3

Thanks. I tried this, but does not success

Is there something I miss?

Error: Request to Elasticsearch failed: {"error":{"root_cause":[{"type":"parse_exception","reason":"failed to parse date field [__missing__] with format [strict_date_optional_time||epoch_millis]"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"logstash-btpn-leads-2018.08","node":"e80Fgn8CRzSBR093BcXl2A","reason":{"type":"parse_exception","reason":"failed to parse date field [__missing__] with format [strict_date_optional_time||epoch_millis]","caused_by":{"type":"illegal_argument_exception","reason":"Parse failure at index [0] of [__missing__]"}}}]},"status":400}
    at Function.Promise.try (
    at (<anonymous>)
    at (
    at callResponseHandlers (
    at processQueue (
    at Scope.$digest (

(system) #4

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