Getting Data In

Monitor windows file using environment variable in the path

bharathkumarnec
Contributor

Hi All,

Can we specify environment variables of windows in the monitor stanza. For example like below:

[monitor://%systemdrive%\windows\Temp\logs.txt]

We have logs.txt in Temp directory and we have different system drives, one server is with C:\ & the other server is with E:.

Can we monitor like above ??

twinspop
Influencer

List both styles? Splunk will ignore inputs that have paths that don't exist.

[monitor://C:\windows\Temp\logs.txt]
foo = bar

[monitor://E:\windows\Temp\logs.txt]
foo = bar
0 Karma

bharathkumarnec
Contributor

Yeah True! But just wanted to check if that way is possible in the Monitor stanza. Just to reduce number of stanzas in inputs.conf file.

0 Karma
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Reprocessing XML into Fixed-Length Events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...