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
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!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...