Filtering by date field (other than the timestamp) in Kibana dashboard

Hello everyone,

I have an index with several fields and more than 1 time field. For examle:

Field names: "end_date", "name", "sequence" & "start_date".

The mapping:

{
  "check_date_filter": {
    "mappings": {
      "_meta": {
        "created_by": "file-data-visualizer"
      },
      "properties": {
        "@timestamp": {
          "type": "date"
        },
        "end_date": {
          "type": "date",
          "format": "dd/MM/yyyy"
        },
        "name": {
          "type": "keyword"
        },
        "sequence": {
          "type": "long"
        },
        "start_date": {
          "type": "date",
          "format": "dd/MM/yyyy"
        }
      }
    }
  }
}

In the dashboard, I'm planning to filter the data based on the "start_date" or "end_date".

The problem is that the time picker filters the data based on the timestamp only and the timestamp can't be chosen to be more than 1 date. For example, if the timestamp was the "start_date", then I will not be able to filter based on the "end_date" and vise versa.

So, I tried to add the date as a filter but it keeps giving me an error.
"P.S: I don't want to filter it using the (Edit as Query DSL)".

  1. Let's say that I have this table:

  2. Adding the filter:

After I click "Update filter", I get the error:

  1. It complained about the format, so , I changed the format in the filter to match the format of the mapping:

But it seems that it doesn't accept this format because I can't click "Update filter".

Is it possible to filter the data in the dashboard based on the dates of different date-fields other than the timestamp directly from the filter, without using (Edit as Query DSL)?

Kibana version v 8.3.3

Regards,

1 Like

Hi @SaraAlshamsi

I think there's a bug in there, I can reproduce it with your setup.
I workaround I found was to define each filter as Query DSL so you can specify the correct format:

{
  "query": {
    "range": {
      "start_date": {
        "gte": "01/12/2022",
        "lte": null
      }
    }
  }
}

hi,

I know this solution and that's why I'm asking if I can filter the data without using the "Query DSL". I want it to be straightforward as if I want to filter it as a string value.

Thanks for the prompt reply ..

Regards,

No I do not think there's an alternative to that as the UI version is converting the date into an ISO-compatible format.

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