<?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 Extended Regex in Inputs.conf in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extended-Regex-in-Inputs-conf/m-p/53538#M13014</link>
    <description>&lt;P&gt;I have some complicated Extended Regexes that give the right files when used with a &lt;CODE&gt;find /|grep -E "regex"&lt;/CODE&gt; but do not work in inputs.conf.&lt;/P&gt;

&lt;P&gt;Here's an example:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[monitor:///files]&lt;BR /&gt;
whitelist = \/(qqq|abc)\/\w+\/wls[0-9]+\/user_projects\/domains\/\w+\/servers\/\w+\/logs\/\w+\.out&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Which would match any of these files when used with a &lt;CODE&gt;find /|grep&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;/files/qqq/foo/wls1234/user_projects/domains/bar/servers/foofoo/logs/foobar.out&lt;BR /&gt;
/files/abc/BAR/wls1234/user_projects/domains/GOO/servers/foofoo/logs/FBAR.out&lt;BR /&gt;
/files/abc/FBAR/wls1234/user_projects/domains/GAR/servers/foofoo/logs/GBAR.out&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;BUT in inputs.conf, it matches a LOT more under /files&lt;/P&gt;

&lt;P&gt;In simple english, I need to match:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;/files/(abc or qqq)/*/wls*/user_projects/domains/*/servers/*/logs/*.out&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Sep 2012 19:40:06 GMT</pubDate>
    <dc:creator>glitchcowboy</dc:creator>
    <dc:date>2012-09-06T19:40:06Z</dc:date>
    <item>
      <title>Extended Regex in Inputs.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extended-Regex-in-Inputs-conf/m-p/53538#M13014</link>
      <description>&lt;P&gt;I have some complicated Extended Regexes that give the right files when used with a &lt;CODE&gt;find /|grep -E "regex"&lt;/CODE&gt; but do not work in inputs.conf.&lt;/P&gt;

&lt;P&gt;Here's an example:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[monitor:///files]&lt;BR /&gt;
whitelist = \/(qqq|abc)\/\w+\/wls[0-9]+\/user_projects\/domains\/\w+\/servers\/\w+\/logs\/\w+\.out&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Which would match any of these files when used with a &lt;CODE&gt;find /|grep&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;/files/qqq/foo/wls1234/user_projects/domains/bar/servers/foofoo/logs/foobar.out&lt;BR /&gt;
/files/abc/BAR/wls1234/user_projects/domains/GOO/servers/foofoo/logs/FBAR.out&lt;BR /&gt;
/files/abc/FBAR/wls1234/user_projects/domains/GAR/servers/foofoo/logs/GBAR.out&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;BUT in inputs.conf, it matches a LOT more under /files&lt;/P&gt;

&lt;P&gt;In simple english, I need to match:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;/files/(abc or qqq)/*/wls*/user_projects/domains/*/servers/*/logs/*.out&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Sep 2012 19:40:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extended-Regex-in-Inputs-conf/m-p/53538#M13014</guid>
      <dc:creator>glitchcowboy</dc:creator>
      <dc:date>2012-09-06T19:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: Extended Regex in Inputs.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extended-Regex-in-Inputs-conf/m-p/53539#M13015</link>
      <description>&lt;P&gt;Have you tried to use recursive directory matching?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///files/.../logs]
whitelist = \w+\.out$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or&lt;BR /&gt;
    [monitor:///files/.../logs]&lt;BR /&gt;
    whitelist = .out$&lt;/P&gt;

&lt;P&gt;Should work.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Sep 2012 20:28:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extended-Regex-in-Inputs-conf/m-p/53539#M13015</guid>
      <dc:creator>jgedeon120</dc:creator>
      <dc:date>2012-09-06T20:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: Extended Regex in Inputs.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extended-Regex-in-Inputs-conf/m-p/53540#M13016</link>
      <description>&lt;P&gt;Nope, there are other 'logs' directories in other places in the /files directory tree (e.g. /files/abc/stuff/logs/XYZ.out) which I don't want to report.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Sep 2012 21:24:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extended-Regex-in-Inputs-conf/m-p/53540#M13016</guid>
      <dc:creator>glitchcowboy</dc:creator>
      <dc:date>2012-09-06T21:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: Extended Regex in Inputs.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extended-Regex-in-Inputs-conf/m-p/53541#M13017</link>
      <description>&lt;P&gt;Then your going to need to work with your blacklists and whitelists more.  The monitor stanza doesn't allow for full regex.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///files/*/wls1234/user_projects/domains/*/servers/*/logs]
whitelist = ^(foobar|FBAR|GBAR)\.out$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/admin/inputsconf" title="Inputs Documentation" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/latest/admin/inputsconf&lt;/A&gt;&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;Note concerning wildcards and monitor:&lt;BR /&gt;
* You can use wildcards to specify your input path for monitored input.&lt;BR /&gt;
Use "..." for recursive directory&lt;BR /&gt;&lt;BR /&gt;
matching and "&lt;EM&gt;" for wildcard matching&lt;BR /&gt;
in a single directory segment.&lt;BR /&gt;
* "..." recurses through directories. This means that /foo/.../bar will&lt;BR /&gt;
match foo/bar, foo/1/bar,&lt;BR /&gt;&lt;BR /&gt;
foo/1/2/bar, etc. &lt;BR /&gt;
* You can use multiple "..." specifications in a single input path.&lt;BR /&gt;
For example: /foo/.../bar/...&lt;BR /&gt;
* The asterisk (&lt;/EM&gt;) matches anything in a single path segment; unlike "...",&lt;BR /&gt;
it does not recurse.  For example,&lt;BR /&gt;&lt;BR /&gt;
/foo/&lt;EM&gt;/bar matches the files /foo/bar,&lt;BR /&gt;
/foo/1/bar, /foo/2/bar, etc. However,&lt;BR /&gt;
it does not match /foo/1/2/bar .    A&lt;BR /&gt;
second example: /foo/m*r/bar matches&lt;BR /&gt;
/foo/bar, /foo/mr/bar,   /foo/mir/bar,&lt;BR /&gt;
/foo/moor/bar, etc. &lt;BR /&gt;
* You can combine "&lt;/EM&gt;" and "..." as required: foo/.../bar/* matches any&lt;BR /&gt;
file in the bar directory within the&lt;BR /&gt;&lt;BR /&gt;
specified path.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:23:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extended-Regex-in-Inputs-conf/m-p/53541#M13017</guid>
      <dc:creator>jgedeon120</dc:creator>
      <dc:date>2020-09-28T12:23:47Z</dc:date>
    </item>
  </channel>
</rss>

