Getting Data In

How to run splunk add monitor without providing user name/password on Win 2012 R2

rajindersingh
Explorer

I am setting up splunk universal forwarder on a windows server 2012 R2 in a fully automated manner.
I have been able to MSI to install splunk. I tried setting up file monitor during the installation and that did not work for some reason.

Now I am trying to setup directory monitoring with splunk add monitor c:\xxxx but I am being prompted for user name and password.
Is there any way to suppress this? I am running this command as local admin user. My VM is not domain joined.

Other thing I noticed is that when I add monitor via command line this information does not show up in input.conf. Is this expected behavior?

Tags (3)
0 Karma

jtrucks
Splunk Employee
Splunk Employee

The username and password the splunk command uses on the CLI is the same it would use for the GUI. That means it is requesting a Splunk username/password combination, like admin/changeme (the default for a new splunk install) or whatever combination you have set up for an admin user that would have permissions to run the command. You can't not have it prompt for that unless you first run $SPLUNK_HOME\bin\splunk login to have a running session.

The added monitor may land in a ...\local\inputs.conf file in a number of places under $SPLUNK_HOME\etc, so do a search for inputs.conf in that directory to find the various places that may contain your new entry or entries.

Alternatively, have something add your monitor stanza to the $SPLUNK_HOME\etc\system\local\inputs.conf file. For details on writing that stanza, see the docs at http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Input.

--
Jesse Trucks
Minister of Magic

rajindersingh
Explorer

splunk is running as a localsystem account.
It does have access to the file system.

I ran splunk add monitor d:\logs and I can see references to d:\logs in splunkd-utility.logs file.
If I run splund list monitor It does show the logs files that were in d:\logs
I don't see the logs show up on the indexer.

I tried restarting the splunk sever but it did not help.
Since splunk list monitor is showing the log files it is storing configuration somewhere but not in input.conf file.

If I manually insert the lines you shared above and restart the service everything works as expected.

I was hoping to avoid updating text files to configure this server but I can do that if it is the only reliable way to configure splunk.

This VM is running in Microsoft Azure and it is a stateless VM so automation is the only way to get splunk forwarder configured.

0 Karma

krish3
Contributor

Just look at this location you should have your entry.

$Splunk_HOME$\etc\apps\search\local\inputs.conf

0 Karma

krish3
Contributor

Does splunk as permission to read and write files under its home directory. Just try adding below lines in input.conf and make sure it is present and restart splunk and share the output. And verify the contents in inputs.conf after splunk comes up.

[monitor://c:\location\to\folder]
disabled = false
followTail = true
index = main

0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...