Dashboards & Visualizations

Populate Dropdown with file/foldernames in specific directorypath

vishal2211
New Member

I have to create a dashboard where I will have a dropdown which gets populated with filename/foldername from specific network path. How can I achieve this.

e.g. I am having network path "\VM\ResultsDir". I want to display all files/folder names inside this directory in drodpwn. How can I achieve this in splunk dashboard?

Tags (1)
0 Karma
1 Solution

FrankVl
Ultra Champion

Do you have those values in Splunk somehow already? I assume you do, since you want to create a dropdown to filter for them?

So assuming you for instance have some index=foo with events that have a file field. You can populate the dropdown with a search like:

index=foo file="\\VM\ResultsDir\*" | stats count by file | fields file

If you don't have the data like that, or you need a full list rather than relying on the values seen in events, I guess you could create some scripted input on the respective host that produces a directory list, ingest that into splunk and maybe even load it into a lookup.

View solution in original post

0 Karma

FrankVl
Ultra Champion

Do you have those values in Splunk somehow already? I assume you do, since you want to create a dropdown to filter for them?

So assuming you for instance have some index=foo with events that have a file field. You can populate the dropdown with a search like:

index=foo file="\\VM\ResultsDir\*" | stats count by file | fields file

If you don't have the data like that, or you need a full list rather than relying on the values seen in events, I guess you could create some scripted input on the respective host that produces a directory list, ingest that into splunk and maybe even load it into a lookup.

0 Karma

vishal2211
New Member

Can you please also guide me how to add index for such scenario? I am fairly new to splunk. I tried to create index via Splunk web > Add Data > monitor> File Or Directory > UNC Path. When I tried to search with given index it shows no result.

0 Karma

FrankVl
Ultra Champion

That sounds like a new question, which is best asked separately to prevent confusion. And to answer it it would help a lot if you provide some more details than just the GUI page used and "it shows no result". This page in the docs also gives some good hints on troubleshooting missing data: https://docs.splunk.com/Documentation/Splunk/7.3.0/Troubleshooting/Cantfinddata

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...