<?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 How is regex in whitelist of inputs monitor for indexing file to start with special characters? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-is-regex-in-whitelist-of-inputs-monitor-for-indexing-file-to/m-p/372472#M109546</link>
    <description>&lt;P&gt;I try to index sybase logs which are located in /sybase/SID/ASE-1(5|6)_0/install/SID.log  (SID is variable System-ID)&lt;/P&gt;

&lt;P&gt;In Whitelist i only want to monitor files with FL2.log or ACE.log normal regex should be ^[A-Z0-9]{3}.log$&lt;/P&gt;

&lt;P&gt;I will use following monitor-stanza on Universal Forwarder:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///sybase/*/ASE-1*_0/install/]
whitelist=^[A-Z0-9]{3}\.log$
sourcetype=source_sybase
index=ios_db
_TCP_ROUTING=splunk_main
disabled=false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But then nothing is indexed.&lt;/P&gt;

&lt;P&gt;If I use the same stanza without the ^(anchor), then too many files like SID.log or SID_JSAGENT.log are indexed.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///sybase/*/ASE-1*_0/install/]
whitelist=[A-Z0-9]{3}\.log$
sourcetype=source_sybase
index=ios_db
_TCP_ROUTING=splunk_main
disabled=false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Does someone have an idea why this is not working or is this a bug in splunk?&lt;/P&gt;</description>
    <pubDate>Fri, 24 Mar 2017 09:04:28 GMT</pubDate>
    <dc:creator>klowk</dc:creator>
    <dc:date>2017-03-24T09:04:28Z</dc:date>
    <item>
      <title>How is regex in whitelist of inputs monitor for indexing file to start with special characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-is-regex-in-whitelist-of-inputs-monitor-for-indexing-file-to/m-p/372472#M109546</link>
      <description>&lt;P&gt;I try to index sybase logs which are located in /sybase/SID/ASE-1(5|6)_0/install/SID.log  (SID is variable System-ID)&lt;/P&gt;

&lt;P&gt;In Whitelist i only want to monitor files with FL2.log or ACE.log normal regex should be ^[A-Z0-9]{3}.log$&lt;/P&gt;

&lt;P&gt;I will use following monitor-stanza on Universal Forwarder:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///sybase/*/ASE-1*_0/install/]
whitelist=^[A-Z0-9]{3}\.log$
sourcetype=source_sybase
index=ios_db
_TCP_ROUTING=splunk_main
disabled=false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But then nothing is indexed.&lt;/P&gt;

&lt;P&gt;If I use the same stanza without the ^(anchor), then too many files like SID.log or SID_JSAGENT.log are indexed.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///sybase/*/ASE-1*_0/install/]
whitelist=[A-Z0-9]{3}\.log$
sourcetype=source_sybase
index=ios_db
_TCP_ROUTING=splunk_main
disabled=false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Does someone have an idea why this is not working or is this a bug in splunk?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 09:04:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-is-regex-in-whitelist-of-inputs-monitor-for-indexing-file-to/m-p/372472#M109546</guid>
      <dc:creator>klowk</dc:creator>
      <dc:date>2017-03-24T09:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: How is regex in whitelist of inputs monitor for indexing file to start with special characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-is-regex-in-whitelist-of-inputs-monitor-for-indexing-file-to/m-p/372473#M109547</link>
      <description>&lt;P&gt;Remember, the regex is matching against ANY PART OF the incoming file name, including the directory.  The same regex DOES match those &lt;CODE&gt;SID_JSAGENT.log&lt;/CODE&gt; files ... the  &lt;CODE&gt;ENT.log&lt;/CODE&gt; part.  &lt;/P&gt;

&lt;P&gt;Try this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; whitelist=\/[A-Z0-9]{3}\.log$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;updated to escape the slash.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 15:21:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-is-regex-in-whitelist-of-inputs-monitor-for-indexing-file-to/m-p/372473#M109547</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-03-24T15:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: How is regex in whitelist of inputs monitor for indexing file to start with special characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-is-regex-in-whitelist-of-inputs-monitor-for-indexing-file-to/m-p/372474#M109548</link>
      <description>&lt;P&gt;Yes that is correct i forgot that is the complete file name with directory. In your answer is only missing the escape before the backslash. Following is working for me:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///sybase/*/ASE-1*_0/install/]
whitelist=\/[A-Z0-9]{3}\.log$
sourcetype=source_sybase
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks for your answer.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 09:35:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-is-regex-in-whitelist-of-inputs-monitor-for-indexing-file-to/m-p/372474#M109548</guid>
      <dc:creator>klowk</dc:creator>
      <dc:date>2017-03-27T09:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: How is regex in whitelist of inputs monitor for indexing file to start with special characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-is-regex-in-whitelist-of-inputs-monitor-for-indexing-file-to/m-p/372475#M109549</link>
      <description>&lt;P&gt;updated.  Please accept the answer so that the question will show complete.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 14:59:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-is-regex-in-whitelist-of-inputs-monitor-for-indexing-file-to/m-p/372475#M109549</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-03-27T14:59:59Z</dc:date>
    </item>
  </channel>
</rss>

