<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Universal forwarder - multiple inputs.conf stanzas on the same folder in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Universal-forwarder-multiple-inputs-conf-stanzas-on-the-same/m-p/417399#M73676</link>
    <description>&lt;P&gt;Hey, thanks for the detailed answer..&lt;/P&gt;

&lt;P&gt;I have one issue left you might be able to help with, using the whitelists works really well. There is only one issue - the files named 'nonprod' are sometimes appearing in the prod index. I've tried blacklisting nonprod in the bottom stanza but that doesnt seem to work.&lt;/P&gt;

&lt;P&gt;The file names contain '-prod.prod' so I could try the below?&lt;/P&gt;

&lt;P&gt;[monitor:///srv/./logs]&lt;BR /&gt;
 whitelist = devint..log$|int..log$|ft..log$|infradev..log$|nonprod.*.log$&lt;BR /&gt;
 sourcetype = service_log&lt;BR /&gt;
 index = nonprod&lt;/P&gt;

&lt;P&gt;[monitor:///srv/logs]&lt;BR /&gt;
 whitelist = ppd..log$|-prod..log$&lt;BR /&gt;
 sourcetype = service_log&lt;BR /&gt;
 index = prod&lt;/P&gt;</description>
    <pubDate>Thu, 23 Aug 2018 15:41:35 GMT</pubDate>
    <dc:creator>Stokers_23</dc:creator>
    <dc:date>2018-08-23T15:41:35Z</dc:date>
    <item>
      <title>Universal forwarder - multiple inputs.conf stanzas on the same folder</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Universal-forwarder-multiple-inputs-conf-stanzas-on-the-same/m-p/417397#M73674</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;

&lt;P&gt;I'm attempting to configure my universal forwarder to read log files from a single directory with multiple subdirectories. We use log rotate so the files will be renamed with (1) up to (4) before starting again. I'm also trying to push those into the right index based on the file name. For example the top level directory is /srv/logs which has multiple subdirectories i.e &lt;/P&gt;

&lt;P&gt;application&lt;BR /&gt;
fileservice&lt;BR /&gt;
proxyserver&lt;/P&gt;

&lt;P&gt;each of these subdirectories contains multiple files from each environment (dev, int, prod etc) Here is an example file name.&lt;/P&gt;

&lt;P&gt;application-prod.prod.log, i'm using the following inputs.conf which seems to work(ish). I've changed the monitor names to ensure they are treated as separate and i'm trying to blacklist anything I don't want to appear in each index.&lt;/P&gt;

&lt;P&gt;[monitor:///srv/./logs]&lt;BR /&gt;
  blacklist = ppd.&lt;EM&gt;.log$|prod.&lt;/EM&gt;.log$&lt;BR /&gt;
  sourcetype = service_log&lt;BR /&gt;
  index = nonprod&lt;BR /&gt;
  crcSalt = &lt;/P&gt;

&lt;P&gt;[monitor:///srv/logs]&lt;BR /&gt;
  blacklist = devint.&lt;EM&gt;.log$|int.&lt;/EM&gt;.log$|ft.&lt;EM&gt;.log$|infradev.&lt;/EM&gt;.log$|nonprod.*.log$&lt;BR /&gt;
  sourcetype = service_log&lt;BR /&gt;
  index = prod&lt;BR /&gt;
  crcSalt = &lt;/P&gt;

&lt;P&gt;So in prod, I only want files that contain .prod and ppd, in nonprod I want devint, int, ft, infradev and nonprod.&lt;/P&gt;

&lt;P&gt;So i'm wondering&lt;BR /&gt;
- Are there better or more performant ways to configure these inputs&lt;BR /&gt;
- Is there anyway I can check the data is correct in my indexes is correct (no prod data in non prod etc)&lt;BR /&gt;
- If there are subdirectories should I be using recursive = true?&lt;BR /&gt;
- The documentation says don't use   crcSalt =  with log rotate - however I see a number of initcrc errors - should I be setting a initcrclen = 2000 etc?&lt;/P&gt;

&lt;P&gt;Sorry this is a long one, thanks for any help.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 15:43:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Universal-forwarder-multiple-inputs-conf-stanzas-on-the-same/m-p/417397#M73674</guid>
      <dc:creator>Stokers_23</dc:creator>
      <dc:date>2018-08-21T15:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Universal forwarder - multiple inputs.conf stanzas on the same folder</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Universal-forwarder-multiple-inputs-conf-stanzas-on-the-same/m-p/417398#M73675</link>
      <description>&lt;P&gt;Hi Stokers_23,&lt;BR /&gt;
for my mental order, i prefer to have different stanzas for each kind of files, so I'd use this stanzas:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///srv/logs/*/*.devint.log]
sourcetype = service_log
index = nonprod
disabled = 0

[monitor:///srv/logs/*/*.int.log]
sourcetype = service_log
index = nonprod
disabled = 0

[monitor:///srv/logs/*/*.infradev.log]
sourcetype = service_log
index = nonprod
disabled = 0

[monitor:///srv/logs/*/*.nonprod.log]
sourcetype = service_log
index = nonprod
disabled = 0

[monitor:///srv/logs/*/*.prod.log]
sourcetype = service_log
index = prod
disabled = 0

[monitor:///srv/logs/*/*.ppd.log]
sourcetype = service_log
index = prod
disabled = 0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Otherwise, if you want to reduce the number of stanzas you could use whitelist instead black list&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///srv/./logs]
whitelist = devint..log$|int..log$|ft..log$|infradev..log$|nonprod.*.log$
sourcetype = service_log
index = nonprod

[monitor:///srv/logs]
whitelist = ppd..log$|prod..log$
sourcetype = service_log
index = prod
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Answering to your questions:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;the more performant ways to configure these inputs is to create a stanza for each input with exact path;&lt;/LI&gt;
&lt;LI&gt;to check if the data is correctly in your indexes, you can run a search like &lt;CODE&gt;index=prod | stats count by source&lt;/CODE&gt; and verify the sources in your index, then repeat the same search for the nonprod index&lt;/LI&gt;
&lt;LI&gt;If there are subdirectories you don't need to put recursive = true you can use asterisk (*) or three points (...)?&lt;/LI&gt;
&lt;LI&gt;crcSalt =  is used only when you want to take logs only from new files, it isn't your case?&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;I hope to be helpful for you.&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 16:40:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Universal-forwarder-multiple-inputs-conf-stanzas-on-the-same/m-p/417398#M73675</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2018-08-21T16:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: Universal forwarder - multiple inputs.conf stanzas on the same folder</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Universal-forwarder-multiple-inputs-conf-stanzas-on-the-same/m-p/417399#M73676</link>
      <description>&lt;P&gt;Hey, thanks for the detailed answer..&lt;/P&gt;

&lt;P&gt;I have one issue left you might be able to help with, using the whitelists works really well. There is only one issue - the files named 'nonprod' are sometimes appearing in the prod index. I've tried blacklisting nonprod in the bottom stanza but that doesnt seem to work.&lt;/P&gt;

&lt;P&gt;The file names contain '-prod.prod' so I could try the below?&lt;/P&gt;

&lt;P&gt;[monitor:///srv/./logs]&lt;BR /&gt;
 whitelist = devint..log$|int..log$|ft..log$|infradev..log$|nonprod.*.log$&lt;BR /&gt;
 sourcetype = service_log&lt;BR /&gt;
 index = nonprod&lt;/P&gt;

&lt;P&gt;[monitor:///srv/logs]&lt;BR /&gt;
 whitelist = ppd..log$|-prod..log$&lt;BR /&gt;
 sourcetype = service_log&lt;BR /&gt;
 index = prod&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 15:41:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Universal-forwarder-multiple-inputs-conf-stanzas-on-the-same/m-p/417399#M73676</guid>
      <dc:creator>Stokers_23</dc:creator>
      <dc:date>2018-08-23T15:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: Universal forwarder - multiple inputs.conf stanzas on the same folder</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Universal-forwarder-multiple-inputs-conf-stanzas-on-the-same/m-p/417400#M73677</link>
      <description>&lt;P&gt;Hi Stokers_23,&lt;BR /&gt;
yes the problem is that &lt;CODE&gt;prod&lt;/CODE&gt; in contained in &lt;CODE&gt;nonprod&lt;/CODE&gt;, so you have to be mo detailed in your regex.&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 15:45:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Universal-forwarder-multiple-inputs-conf-stanzas-on-the-same/m-p/417400#M73677</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2018-08-23T15:45:51Z</dc:date>
    </item>
  </channel>
</rss>

