<?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: Is it possible to have separate indexes within a single monitored directory? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-have-separate-indexes-within-a-single/m-p/279007#M53395</link>
    <description>&lt;P&gt;In inputs.conf file &lt;BR /&gt;
&lt;STRONG&gt;Option1: Monitor specific files only&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///var/log/filetype1*.log]
sourcetype = mysourcetype1
index = myindex1

[monitor:///var/log/filetype2*.log]
sourcetype = mysourcetype2
index = myindex2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Option2: Use combination of Blacklist if the first filter is too generic&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    [monitor:///var/log/filetype*.log]
    sourcetype = mysourcetype1
    index = myindex1
   # Below will blacklist if you want to protect some files that need not to be indexed
    [blacklist:///var/log/filetype2*.log]  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Option3: Use combination of inputs, props &amp;amp; transforms&lt;/STRONG&gt;&lt;BR /&gt;
inputs.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [monitor:///var/log/filetype*.log]
sourcetype = mysourcetype1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In props.conf &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mysourcetype1]
 TRANSFORMS-set_index_myindex = set_index_myindex
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which references this in transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [set_index_myindex]
 SOURCE_KEY = MetaData:Host
 REGEX = ^host::192\.168\.1\.1$
 FORMAT = index::myindex1
 DEST_KEY = _MetaData:Index
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 24 Oct 2016 19:11:48 GMT</pubDate>
    <dc:creator>koshyk</dc:creator>
    <dc:date>2016-10-24T19:11:48Z</dc:date>
    <item>
      <title>Is it possible to have separate indexes within a single monitored directory?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-have-separate-indexes-within-a-single/m-p/279006#M53394</link>
      <description>&lt;P&gt;I have a single directory being monitored. Via Splunk GUI, you can only select a single index for the logs to be outputted to. There are dozens of different types of logs, but there is a specific kind of log (.log files) that I would like indexed into a separate index.&lt;/P&gt;

&lt;P&gt;The help I have seen so far shows to explicitly list all file types and direct accordingly. I would like to only have to list the ones I would like redirected.&lt;/P&gt;

&lt;P&gt;Any help would be appreciated! Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 18:40:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-have-separate-indexes-within-a-single/m-p/279006#M53394</guid>
      <dc:creator>cmeyers</dc:creator>
      <dc:date>2016-10-24T18:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to have separate indexes within a single monitored directory?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-have-separate-indexes-within-a-single/m-p/279007#M53395</link>
      <description>&lt;P&gt;In inputs.conf file &lt;BR /&gt;
&lt;STRONG&gt;Option1: Monitor specific files only&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///var/log/filetype1*.log]
sourcetype = mysourcetype1
index = myindex1

[monitor:///var/log/filetype2*.log]
sourcetype = mysourcetype2
index = myindex2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Option2: Use combination of Blacklist if the first filter is too generic&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    [monitor:///var/log/filetype*.log]
    sourcetype = mysourcetype1
    index = myindex1
   # Below will blacklist if you want to protect some files that need not to be indexed
    [blacklist:///var/log/filetype2*.log]  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Option3: Use combination of inputs, props &amp;amp; transforms&lt;/STRONG&gt;&lt;BR /&gt;
inputs.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [monitor:///var/log/filetype*.log]
sourcetype = mysourcetype1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In props.conf &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mysourcetype1]
 TRANSFORMS-set_index_myindex = set_index_myindex
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which references this in transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [set_index_myindex]
 SOURCE_KEY = MetaData:Host
 REGEX = ^host::192\.168\.1\.1$
 FORMAT = index::myindex1
 DEST_KEY = _MetaData:Index
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Oct 2016 19:11:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-have-separate-indexes-within-a-single/m-p/279007#M53395</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2016-10-24T19:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to have separate indexes within a single monitored directory?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-have-separate-indexes-within-a-single/m-p/279008#M53396</link>
      <description>&lt;P&gt;I have input directories with 5 different index destinations based on the file name of the log file in the directory.  To do this I use the Splunk file directory monitor UI and introduce wildcards in the source to differentiate different log names types.&lt;BR /&gt;
Can you post the names of the log files in the directory and how you want to separate them to different indexes?&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 19:12:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-have-separate-indexes-within-a-single/m-p/279008#M53396</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2016-10-24T19:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to have separate indexes within a single monitored directory?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-have-separate-indexes-within-a-single/m-p/279009#M53397</link>
      <description>&lt;P&gt;1- I have one syslog server where &lt;STRONG&gt;all the network devices sending logs&lt;/STRONG&gt; and that logs are saving at&lt;BR /&gt;
/central/$hostname$/$hostname$.log&lt;BR /&gt;
2- I install UF on that syslog server and configure it to send logs to HF.&lt;/P&gt;

&lt;P&gt;whats should be my regex here&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2018 12:46:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-have-separate-indexes-within-a-single/m-p/279009#M53397</guid>
      <dc:creator>riqbal</dc:creator>
      <dc:date>2018-05-21T12:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to have separate indexes within a single monitored directory?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-have-separate-indexes-within-a-single/m-p/279010#M53398</link>
      <description>&lt;P&gt;personally, i feel you need to do filtering at syslog level, so your syslog will log it in better way so you can identify the source/ip etc. as early as possible.&lt;/P&gt;

&lt;P&gt;Please try changing your syslog template so it will log as&lt;BR /&gt;
/central/$host-ip/$port/$facility.$severity.log  &lt;/P&gt;

&lt;H1&gt;This will ensure, the data from each source-ip , from each facility &amp;amp; port is logged separately as possible. (better to use host-ip than hostname as hostname is not guaranteed)&lt;/H1&gt;

&lt;P&gt;You can do via regex in splunk, but that's harder work than splitting at source if possible&lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2018 14:25:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-have-separate-indexes-within-a-single/m-p/279010#M53398</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2018-05-25T14:25:11Z</dc:date>
    </item>
  </channel>
</rss>

