Getting Data In

Drop Down based on its filename

Azwaliyana
Path Finder

I have a filename like this


-11112021_MOS.csv

-12112021_MOS.csv

-13112021_MOS.csv

 

I want to create drop down based on the date. How can I do that?

Labels (1)
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@Azwaliyana 

As per my understanding, you need to filter dropdown values (files) on the basis of the date defined in the file name on. change of  timerange. then try below search in your dropdown.

YOUR_SEARCH
| eval file_date= strptime(Filename,"%d%m%Y_MOS.csv") 
| addinfo 
| where file_date>=info_min_time and file_date<info_max_time

 

My Sample Search :

| makeresults 
| eval _raw="Filename
11112021_MOS.csv
12112021_MOS.csv
13112021_MOS.csv" 
| multikv forceheader=1 
| table Filename 
| rename comment as "Upto now is for sample data only" 
| eval file_date= strptime(Filename,"%d%m%Y_MOS.csv") 
| addinfo 
| where file_date>=info_min_time and file_date<info_max_time

 

You have have different use case then please share more details on it.

Thanks
KV
▄︻̷̿┻̿═━一   😉

If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...