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!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...