Splunk Dev

Validating the file name in splunk

mahbs
Path Finder

Hi,

I was just wondering, is there a way to validate the name of the file that is being ingested into splunk?

So for example, if the file name is: "filename 20180124" I would have thought a regular expression could be used to validate that, but the question is, how do I use a query to display the file name into the console and then validate it?

Could someone shed some light on this?

Thanks

Tags (1)
0 Karma

FrankVl
Ultra Champion

Is the filename in the source field (as usual)?

Then you could do something like:

...base search...
| eval validFileName=(if(match(source,"<validation regex>"),"Yes", "No"))
0 Karma

mayurr98
Super Champion

are you looking for a list of file names that are been index by Splunk?

0 Karma

mahbs
Path Finder

Hey @mayurr98, not a list, but I've created dashboards per file. The Splunk picks up the file from the splunk server and ingests it. For that file that is being picked up, in that dashboard, I want to create a panel that basically checks to see if the file name conforms to the intended design

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...