Getting Data In

What is the difference between these two configurations in inputs.conf on Universal Forwarder?

kteng2024
Path Finder

Under inputs.conf on Universal Forwarder (UF), i have these config as below:-

1.) [monitor:///var/home/jboss/logs/*.log]
disabled = false
followTail = 0
sourcetype= xyz

2.) [monitor:///export/home/tomcat/*.log]
disabled = false
followTail = 0
index = abc_tomcat
sourcetype = pqrs

My questions are ,
a.) index is not configured in 1st monitor stanza whereas index is configured in 2nd monitor stanza, so where will the 1st monitor stanza logs will be going , to the main_index ?

b.) is this really a good configuration ?

c.) do we really need followTail=0 , this option is only used by Splunk for the first time it is monitoring this log which says to read from first line

d) any Suggestions to change this configuration of monitor stanza ?

0 Karma
1 Solution

somesoni2
Revered Legend

My Answers are ,
a.) index is not configured in 1st monitor stanza whereas index is configured in 2nd monitor stanza, so where will the 1st monitor stanza logs will be going , to the main_index ?
** It'll go to the default index which is 'main'. This setting is setup in $Splunk_Home/etc/system/default/inputs.conf (file which you should never update).**

b.) is this really a good configuration ?
People generally use custom indexes with more relavant name, so that only relevant data is stored together. It also allows you to secure the data without affecting other users.

c.) do we really need followTail=0 , this option is only used by splunk for the first time it is monitoring this log which says to read from first line
Not required. The default value itself is 0 for followTail. It's an advanced configuration which should be used only for very specific cases and carefully.

d) any Suggestions to change this configuration of monitor stanza ?
*Would suggest to provide as custom index name. I'm assuming the word 'mointor' is typo in the first stanza, otherwise correct that as well. If the files to be monitored are following specific name, include the contant portion of the file name so that you're not using 100% wildcarded files. *

View solution in original post

somesoni2
Revered Legend

My Answers are ,
a.) index is not configured in 1st monitor stanza whereas index is configured in 2nd monitor stanza, so where will the 1st monitor stanza logs will be going , to the main_index ?
** It'll go to the default index which is 'main'. This setting is setup in $Splunk_Home/etc/system/default/inputs.conf (file which you should never update).**

b.) is this really a good configuration ?
People generally use custom indexes with more relavant name, so that only relevant data is stored together. It also allows you to secure the data without affecting other users.

c.) do we really need followTail=0 , this option is only used by splunk for the first time it is monitoring this log which says to read from first line
Not required. The default value itself is 0 for followTail. It's an advanced configuration which should be used only for very specific cases and carefully.

d) any Suggestions to change this configuration of monitor stanza ?
*Would suggest to provide as custom index name. I'm assuming the word 'mointor' is typo in the first stanza, otherwise correct that as well. If the files to be monitored are following specific name, include the contant portion of the file name so that you're not using 100% wildcarded files. *

s2_splunk
Splunk Employee
Splunk Employee

Yes, if you don't specify an index, events will be routed to the default index, which is main.
I would call it a best practice to ALWAYS configure sourcetype and index explicitly for any input.

The default for followTail is 0 (false), so specifying it here is redundant.

So the only two differences for these two inputs are the sourcetype attributed and the target index.

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!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...