<?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: Expand inputs.conf with wildcards in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Expand-inputs-conf-with-wildcards/m-p/139389#M28667</link>
    <description>&lt;P&gt;I assume the poster downvoted me because I didn't provide a ready to use answer, so now there is one. Please upvote it and accept as working if you test this and it works.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Nov 2013 22:04:33 GMT</pubDate>
    <dc:creator>jtrucks</dc:creator>
    <dc:date>2013-11-12T22:04:33Z</dc:date>
    <item>
      <title>Expand inputs.conf with wildcards</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Expand-inputs-conf-with-wildcards/m-p/139387#M28665</link>
      <description>&lt;P&gt;Does anyone know of a tool that will 'expand' the monitor stanza from inputs.conf on a universalforwarder to show an example of logs to be watched?&lt;/P&gt;

&lt;P&gt;I.e., I have a monitor stanza:&lt;/P&gt;

&lt;P&gt;[monitor:///path/to/some/*/dir]&lt;BR /&gt;
whitelist = /file_name(s).log$&lt;/P&gt;

&lt;P&gt;And before I restart splunk and do the 'hope it works' I was wondering if there was a tool that would, using Splunk's logic, show me all the files the above would 'see' for monitoring.&lt;/P&gt;

&lt;P&gt;I have multiple 'client' directories (being replaced above by the *) where some have specific logs and some do not.  I would rather write one monitor for each type of log verses writing a new monitor stanza per client dir/log type. &lt;/P&gt;

&lt;P&gt;And I need to test it before pulling the trigger and not impact other, already configured, data-gathering.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2013 21:15:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Expand-inputs-conf-with-wildcards/m-p/139387#M28665</guid>
      <dc:creator>tyronetv</dc:creator>
      <dc:date>2013-11-12T21:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Expand inputs.conf with wildcards</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Expand-inputs-conf-with-wildcards/m-p/139388#M28666</link>
      <description>&lt;P&gt;A fairly simplistic approach is just to use ls:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ls -d /path/to/some/*/dir
ls -d /path/to/some/*/dir/file_name*.log
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The results is how the system will glob the filenames and create paths.&lt;/P&gt;

&lt;P&gt;Also, you could quickly write something in perl, python, C, or any other language with a similar function. Then you could have that program pull any line with "[monitor…]" to parse the paths and glob them for you.&lt;/P&gt;

&lt;P&gt;For a working way to do this really quick and dirty, do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ls -d $( awk '/monitor/' inputs.conf| sed -e 's|\[monitor://||' -e 's|\]$||')
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Obviously adjust where you run this or specify full path to inputs.conf.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2013 21:38:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Expand-inputs-conf-with-wildcards/m-p/139388#M28666</guid>
      <dc:creator>jtrucks</dc:creator>
      <dc:date>2013-11-12T21:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: Expand inputs.conf with wildcards</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Expand-inputs-conf-with-wildcards/m-p/139389#M28667</link>
      <description>&lt;P&gt;I assume the poster downvoted me because I didn't provide a ready to use answer, so now there is one. Please upvote it and accept as working if you test this and it works.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2013 22:04:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Expand-inputs-conf-with-wildcards/m-p/139389#M28667</guid>
      <dc:creator>jtrucks</dc:creator>
      <dc:date>2013-11-12T22:04:33Z</dc:date>
    </item>
    <item>
      <title>Re: Expand inputs.conf with wildcards</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Expand-inputs-conf-with-wildcards/m-p/139390#M28668</link>
      <description>&lt;P&gt;The awk statement is fine and almost a mirror of what I've already done. I am looking for something that essentially mimics the expansion of the entire monitor stanza to include file names identified by the white/black lists as well as the monitor line.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2013 22:38:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Expand-inputs-conf-with-wildcards/m-p/139390#M28668</guid>
      <dc:creator>tyronetv</dc:creator>
      <dc:date>2013-11-12T22:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: Expand inputs.conf with wildcards</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Expand-inputs-conf-with-wildcards/m-p/139391#M28669</link>
      <description>&lt;P&gt;There isn't a premade tool that does that to date that anyone has published. It might make a good feature request to Splunk.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2013 22:42:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Expand-inputs-conf-with-wildcards/m-p/139391#M28669</guid>
      <dc:creator>jtrucks</dc:creator>
      <dc:date>2013-11-12T22:42:26Z</dc:date>
    </item>
  </channel>
</rss>

