<?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 Is it possible to use regex in an inputs.conf monitor stanza? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-regex-in-an-inputs-conf-monitor-stanza/m-p/216029#M63360</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Is it possible to do something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[MONITOR:///some directory/WE\d{8}.log]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;for indexing the following filenames:&lt;BR /&gt;
WE93820493.log&lt;BR /&gt;
WE37245293.log&lt;/P&gt;

&lt;P&gt;I don't want to index the following filename: WE93820493corrupt.log and WE37245293test.log which are indexed with this inputs.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[MONITOR:///some directory/WE*.log]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If it is not possible, is there a way to setup my stanza so I get a similar behavior?&lt;BR /&gt;
Thanks,&lt;/P&gt;</description>
    <pubDate>Fri, 30 Oct 2015 22:32:17 GMT</pubDate>
    <dc:creator>edrivera3</dc:creator>
    <dc:date>2015-10-30T22:32:17Z</dc:date>
    <item>
      <title>Is it possible to use regex in an inputs.conf monitor stanza?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-regex-in-an-inputs-conf-monitor-stanza/m-p/216029#M63360</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Is it possible to do something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[MONITOR:///some directory/WE\d{8}.log]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;for indexing the following filenames:&lt;BR /&gt;
WE93820493.log&lt;BR /&gt;
WE37245293.log&lt;/P&gt;

&lt;P&gt;I don't want to index the following filename: WE93820493corrupt.log and WE37245293test.log which are indexed with this inputs.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[MONITOR:///some directory/WE*.log]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If it is not possible, is there a way to setup my stanza so I get a similar behavior?&lt;BR /&gt;
Thanks,&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2015 22:32:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-regex-in-an-inputs-conf-monitor-stanza/m-p/216029#M63360</guid>
      <dc:creator>edrivera3</dc:creator>
      <dc:date>2015-10-30T22:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use regex in an inputs.conf monitor stanza?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-regex-in-an-inputs-conf-monitor-stanza/m-p/216030#M63361</link>
      <description>&lt;P&gt;I think you can do what you want a number of ways but I would probably try using whitelist or blacklist in the monitor stanza.&lt;BR /&gt;
I've listed the details on those from the reference the &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Admin/Inputsconf"&gt;inputs.conf&lt;/A&gt; spec.&lt;/P&gt;

&lt;P&gt;whitelist = &lt;BR /&gt;
* If set, files from this input are monitored only if their path matches the specified regex.&lt;/P&gt;

&lt;P&gt;blacklist = &lt;BR /&gt;
* If set, files from this input are NOT monitored if their path matches the specified regex.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2015 23:58:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-regex-in-an-inputs-conf-monitor-stanza/m-p/216030#M63361</guid>
      <dc:creator>mtranchita</dc:creator>
      <dc:date>2015-10-30T23:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use regex in an inputs.conf monitor stanza?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-regex-in-an-inputs-conf-monitor-stanza/m-p/216031#M63362</link>
      <description>&lt;P&gt;The @mtranchita answer is the correct one but if you need to do something beyond RegEx, you can use this approach (but use additional logic):&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/309910/how-to-monitor-a-folder-for-newest-files-only-file.html"&gt;https://answers.splunk.com/answers/309910/how-to-monitor-a-folder-for-newest-files-only-file.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 31 Oct 2015 02:56:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-regex-in-an-inputs-conf-monitor-stanza/m-p/216031#M63362</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-10-31T02:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use regex in an inputs.conf monitor stanza?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-regex-in-an-inputs-conf-monitor-stanza/m-p/216032#M63363</link>
      <description>&lt;P&gt;I already know to use whitelist and blacklist, the problem is that those files  are touched by different users and they don't use a standard way to name them. The only thing that I am sure is that they reserved this formal format: WEXXXXXXXX.log for official use.  Thanks anyway for your response.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Nov 2015 17:40:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-regex-in-an-inputs-conf-monitor-stanza/m-p/216032#M63363</guid>
      <dc:creator>edrivera3</dc:creator>
      <dc:date>2015-11-02T17:40:54Z</dc:date>
    </item>
  </channel>
</rss>

