Mahebub A Sayyed
Mahebub A Sayyed

Reputation: 364

How to change Kibana-4's default Time Filter?

I have created a dashboard in Kibana-4 and shared on my Web-app. But its default time filter is 15 minutes.
How to change the default time filter in kibana-4?

Upvotes: 9

Views: 7463

Answers (4)

sid8491
sid8491

Reputation: 6800

At least as of Kibana version 7.4, and possibly for earlier releases as well:

From the left menu click on Management, then select Advanced Settings from the Kibana top menu.

Here you can change the defaults of a Kibana dashboard.

Search for timepicker:timeDefaults and click on edit and change the from value from now-15m to the value you want to set, using s for seconds, m for minutes, h for hours, w for weeks, M for months, d for days, or y for years.

I wanted to see data of past 2 years so I have set it as
{ "from": "now-2y", "to": "now", "mode": "quick" }

Finally, click on the Save button to the right of the edited field:Time filter defaults

Hope it helps.

Upvotes: 4

kenzie
kenzie

Reputation: 2701

In 4.5.0, you should be able to change it anytime in the Kibana ui by navigating to "Settings"->"Advanced". See this link. Just edit the timepicker:timeDefaults to something like { "from": "now-90d", "to": "now", "mode": "quick" }

Upvotes: 15

Ben Tse
Ben Tse

Reputation: 659

You can preset time filter in dashboard link. For example setting to last 6 hours:

kibana-host:5601/#/dashboard/My-Dashboard?_g=(time:(from:now-6h,mode:quick,to:now))

Upvotes: 9

gillyb
gillyb

Reputation: 8910

The time-filter is not saved as part of the dashboard, and shouldn't be in my opinion. A dashboard shows you the data organized in a certain kind of way, and each user should be able to modify the date-range of their view however they see fit.

If you're interested in changing the kibana default, you can do so by modifying the code.
Go to the file 'services/timefilter.js', and there is a variable called timeDefaults. You can modify it to match the default value you're interested in.

In the code it looks like this:

var timeDefaults = {
    from: 'now-15m',
    to: 'now'
};

The from and to properties are parsed using ISO8601 format.

Upvotes: 7

Related Questions