Dashboards & Visualizations

Can you deploy year wise filter in the splunk dashboard?

shailesh069
Engager

I get the string and match the string but it has to go through all the database , so getting performance issue

0 Karma
1 Solution

FrankVl
Ultra Champion

@shailesh069 can you share your current search, so we can help you improve it?

Should be as simple as: earliest="1/1/2018:00:00:00" latest="1/1/2019:00:00:00" to get all events from 2018.

Edit: for integrating that in a dashboard with a dropdown: Define a dropdown with the desired selection of years as names and the respective earliest/latest filters as values. Assign a token and use that token in your dashboard's search query.

View solution in original post

shailesh069
Engager

@FrankVl But this " earliest="1/1/2018:00:00:00" latest="1/1/2019:00:00:00" " is hardcoded. I want a dropdown in the dashoard , in which if I select "2019" is in dropdown then it should filter the data in the dashboard according to that year. How can we do it.

What I did is I created a dropdown with the "2019", "2018", "2017" after that when user click it, I am doing my filter. So this way it has to see whole events to extract. But what I wan to do is when user clicks the "2019" the events restricted itself to the "2019" events

0 Karma

FrankVl
Ultra Champion

Then define a dropdown with those years as names and the respective earliest/latest filters as values. Assign a token and use that token in your dashboard's search query.

0 Karma

shailesh069
Engager

@FrankVl Thanks a lot , I got it. I will try this.

0 Karma

FrankVl
Ultra Champion

Good luck. I changed my earlier comment to an answer and added this part as well. If it works for you, please mark that answer as accepted 🙂

0 Karma

FrankVl
Ultra Champion

@shailesh069 can you share your current search, so we can help you improve it?

Should be as simple as: earliest="1/1/2018:00:00:00" latest="1/1/2019:00:00:00" to get all events from 2018.

Edit: for integrating that in a dashboard with a dropdown: Define a dropdown with the desired selection of years as names and the respective earliest/latest filters as values. Assign a token and use that token in your dashboard's search query.

p_gurav
Champion

Did you try using splunk internal field called date_year?

0 Karma

FrankVl
Ultra Champion

That is dangerous as it will only be available when splunk parses the time from the event content. If you have data sources where you use "current time" for the timestamp, it will not have those date_ fields. Also, those field can be disabled (for performance reasons).

0 Karma
Get Updates on the Splunk Community!

What You Read The Most: Splunk Lantern’s Most Popular Articles!

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Announcing the General Availability of Splunk Enterprise Security 8.1!

We are pleased to announce the general availability of Splunk Enterprise Security 8.1. Splunk becomes the only ...

Developer Spotlight with William Searle

The Splunk Guy: A Developer’s Path from Web to Cloud William is a Splunk Professional Services Consultant with ...