Getting Data In

How can I monitor the same file on different drives in windows?

deloach
Engager

I'm trying to monitor the same file on different drives on Windows systems. I tried putting a wildcard into the inputs.conf but that doesn't seem to work for a drive letter.

For instance I have these two different paths:
C:\Program Files\folder\file.txt
D:\Program Files\folder\file.txt

I tried editing my inputs.conf as below
[monitor://*:\Program Files\folder\file.txt]
[monitor://Program Files\folder\file.txt]

No luck with either one and I haven't been able to find any other questions addressing this.

Tags (1)
0 Karma

khushi4u21
Engager

was the solution found for this requirement to monitor same files under different directories ?

anewell
Path Finder

If you need a solution for a fleet of hosts, where one file might appear in a number of different known locations across different endpoints, due to inconsistent builds or what have you.. Splunk honors Windows environment variables, but does so with "linuxy" syntax. So I have the build orchestration set a system-wide envvar %APPLOGS% to either "C:\path" or "D:\path" on the host, and then do a [monitor://$APPLOGS\file.log] stanza in my inputs.conf. The key is the two different dialects of environment variable.

0 Karma

khushi4u21
Engager

Actually we can not get this env variable created on thousands of desktops. Need a generic solution which can only be implemented using splunk config.

0 Karma

jstockamp
Communicator

You could try a regex in the path:

[monitor://[A-Z]:\Program Files\folderfile.txt]

http://docs.splunk.com/Documentation/Splunk/5.0.3/Data/Specifyinputpathswithwildcards

aholzer
Motivator

I believe you are looking for the ellipses option. See documentation:
http://docs.splunk.com/Documentation/Splunk/5.0.3/Data/Specifyinputpathswithwildcards

0 Karma
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

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

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...