Getting Data In

How do you monitor a directory in a client server

lew
New Member

I'm new to splunk. I am trying to monitor a directory that exists on a different server other than the main splunk server. I have accessed the gui and have gone to settings>data inputs>files & directories>new, but I only get a directory listing for the main splunk server, not the clients. The directory in question also has rotating log files if that matters. thanks

Tags (2)
0 Karma
1 Solution

dineshraj9
Builder

If you want to monitor /home/user1/logs/ -

/home/user1/logs/log_type1.log
/home/user1/logs/log_type2.log

You can try putting this in inputs.conf -

[monitor:///home/user1/logs/]
sourcetype = user1_log
index = user
followSymlink=false
blacklist = (.(tar|gz|bz2|tar.gz|tgz|tbz|tbz2|zip|z)$)
whitelist=log_type.+.log$

View solution in original post

0 Karma

dineshraj9
Builder

If you want to monitor /home/user1/logs/ -

/home/user1/logs/log_type1.log
/home/user1/logs/log_type2.log

You can try putting this in inputs.conf -

[monitor:///home/user1/logs/]
sourcetype = user1_log
index = user
followSymlink=false
blacklist = (.(tar|gz|bz2|tar.gz|tgz|tbz|tbz2|zip|z)$)
whitelist=log_type.+.log$

0 Karma

lew
New Member

thank you. This answers my question.

0 Karma

lew
New Member

I have that installed already in the client server

0 Karma

MuS
SplunkTrust
SplunkTrust

Hi lew,

to do this, it is recommended to install an universal forwarder on the remote server, read the docs about it here http://docs.splunk.com/Documentation/Splunk/6.2.3/Forwarding/Introducingtheuniversalforwarder

If you are not able to install it on the remote server, think of any other option to access the file like network share, FTP upload to the Splunk server. But remember, when ever possible use the universal forwarder to get remote logs.

Hope this helps ...

cheers, MuS

0 Karma

lew
New Member

lol, ok. Thanks anyway

0 Karma

lew
New Member

Thank you for the reply. Can you be more specific? The only file I found that matches the contents of that webpage is /splunk/etc/system/README/inputs.conf.spec. So far I have gathered that the scheme is going to look like this.

[monitor: ///path.../logs]

But what I don't understand is how is the indexer server going to know what client server this is going to be for (like hostname yyy.com, for example). Thank you.

0 Karma

MuS
SplunkTrust
SplunkTrust
0 Karma

lew
New Member

I have universal fowarder installed in the client server already

0 Karma

MuS
SplunkTrust
SplunkTrust

take a look at the inputs.conf docs http://docs.splunk.com/Documentation/Splunk/6.2.3/admin/inputsconf you must specify your input on the remote server and save the file at $SPLUNK_HOME\etc\system\local\ and for safety restart the universal forwarder once

0 Karma
Get Updates on the Splunk Community!

Fall Into Learning with New Splunk Education Courses

Every month, Splunk Education releases new courses to help you branch out, strengthen your data science roots, ...

Super Optimize your Splunk Stats Searches: Unlocking the Power of tstats, TERM, and ...

By Martin Hettervik, Senior Consultant and Team Leader at Accelerate at Iver, Splunk MVPThe stats command is ...

How Splunk Observability Cloud Prevented a Major Payment Crisis in Minutes

Your bank's payment processing system is humming along during a busy afternoon, handling millions in hourly ...