<?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: How can I use wildcards (*) for the source stanza in props.conf? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-use-wildcards-for-the-source-stanza-in-props-conf/m-p/201293#M39835</link>
    <description>&lt;P&gt;[Old broken answer has been edited, so the following may not match the comments below]&lt;/P&gt;

&lt;P&gt;In props.conf, you can specify the source using a regular expression (as well as with the "normal" wildcards). Therefore, this should work.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/opt/splunk/var/log/syslog/.*?lx0001.*?/.*]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above stanza should match exactly what you want. But it would be even better if you replaced the &lt;CODE&gt;.*?&lt;/CODE&gt; with more precise regex matching; this is pretty open-ended.&lt;/P&gt;

&lt;P&gt;When you have time (it is long), read the header of the &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Admin/Propsconf"&gt;props.conf.spec&lt;/A&gt; file carefully and you will find a wealth of good information. &lt;/P&gt;</description>
    <pubDate>Wed, 28 Oct 2015 06:35:00 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2015-10-28T06:35:00Z</dc:date>
    <item>
      <title>How can I use wildcards (*) for the source stanza in props.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-use-wildcards-for-the-source-stanza-in-props-conf/m-p/201290#M39832</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;In my live splunk environment, I have a syslog receiver on a Linux machine putting all incoming logs in &lt;CODE&gt;/opt/splunk/var/log/syslog/&lt;/CODE&gt;&lt;BR /&gt;
In the syslog folder, sub folders are created for each syslog source and in that sub folder, each source's log files are written down.&lt;BR /&gt;
Example: &lt;CODE&gt;/opt/splunk/var/log/syslog/example123-lx0001-10.10.10.10/example.log&lt;/CODE&gt;&lt;BR /&gt;
I then pull those log files into Splunk via an agent/UF.&lt;/P&gt;

&lt;P&gt;That syslog receiver (that's actually several machines) receives logs from several hundreds of hosts and what I want to do is to apply a props configuration on every source that includes &lt;CODE&gt;lx001&lt;/CODE&gt; in the host name of the syslog source.&lt;/P&gt;

&lt;P&gt;What I've tried, but not gotten to work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/opt/splunk/var/log/syslog/*lx0001*]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would be so glad if someone could lead me in the right direction.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2015 16:15:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-use-wildcards-for-the-source-stanza-in-props-conf/m-p/201290#M39832</guid>
      <dc:creator>jonatanjosefson</dc:creator>
      <dc:date>2015-10-27T16:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use wildcards (*) for the source stanza in props.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-use-wildcards-for-the-source-stanza-in-props-conf/m-p/201291#M39833</link>
      <description>&lt;P&gt;How about this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/opt/splunk/var/log/syslog/*lx0001*] 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Oct 2015 16:47:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-use-wildcards-for-the-source-stanza-in-props-conf/m-p/201291#M39833</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-10-27T16:47:45Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use wildcards (*) for the source stanza in props.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-use-wildcards-for-the-source-stanza-in-props-conf/m-p/201292#M39834</link>
      <description>&lt;P&gt;I corrected my post since it in fact was possible to write wildcards in the text. Unfortunately that stanza is what I've tried and not got to work.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2015 05:51:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-use-wildcards-for-the-source-stanza-in-props-conf/m-p/201292#M39834</guid>
      <dc:creator>jonatanjosefson</dc:creator>
      <dc:date>2015-10-28T05:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use wildcards (*) for the source stanza in props.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-use-wildcards-for-the-source-stanza-in-props-conf/m-p/201293#M39835</link>
      <description>&lt;P&gt;[Old broken answer has been edited, so the following may not match the comments below]&lt;/P&gt;

&lt;P&gt;In props.conf, you can specify the source using a regular expression (as well as with the "normal" wildcards). Therefore, this should work.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/opt/splunk/var/log/syslog/.*?lx0001.*?/.*]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above stanza should match exactly what you want. But it would be even better if you replaced the &lt;CODE&gt;.*?&lt;/CODE&gt; with more precise regex matching; this is pretty open-ended.&lt;/P&gt;

&lt;P&gt;When you have time (it is long), read the header of the &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Admin/Propsconf"&gt;props.conf.spec&lt;/A&gt; file carefully and you will find a wealth of good information. &lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2015 06:35:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-use-wildcards-for-the-source-stanza-in-props-conf/m-p/201293#M39835</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2015-10-28T06:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use wildcards (*) for the source stanza in props.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-use-wildcards-for-the-source-stanza-in-props-conf/m-p/201294#M39836</link>
      <description>&lt;P&gt;Unfortunately, neither work.&lt;/P&gt;

&lt;P&gt;I also cannot find any official info that you're able to use whitelist in props.conf&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2015 07:51:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-use-wildcards-for-the-source-stanza-in-props-conf/m-p/201294#M39836</guid>
      <dc:creator>jonatanjosefson</dc:creator>
      <dc:date>2015-10-28T07:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use wildcards (*) for the source stanza in props.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-use-wildcards-for-the-source-stanza-in-props-conf/m-p/201295#M39837</link>
      <description>&lt;P&gt;Oh - shoot me now! My head was in &lt;CODE&gt;inputs.conf&lt;/CODE&gt; while I was clearly working with &lt;CODE&gt;props.conf&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Above answer is completely revised. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2015 23:48:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-use-wildcards-for-the-source-stanza-in-props-conf/m-p/201295#M39837</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2015-10-28T23:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use wildcards (*) for the source stanza in props.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-use-wildcards-for-the-source-stanza-in-props-conf/m-p/201296#M39838</link>
      <description>&lt;P&gt;Yeah that regex checks out on my different sources testing it outside Splunk but it doesn't work in my props.conf. Are you really able to write regex simply like that in the source stanza?&lt;/P&gt;

&lt;P&gt;Thanks for your time.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2015 14:35:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-use-wildcards-for-the-source-stanza-in-props-conf/m-p/201296#M39838</guid>
      <dc:creator>jonatanjosefson</dc:creator>
      <dc:date>2015-10-29T14:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use wildcards (*) for the source stanza in props.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-use-wildcards-for-the-source-stanza-in-props-conf/m-p/201297#M39839</link>
      <description>&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/397051/can-you-regex-or-wildcard-props-sourcetype-stanzas.html"&gt;https://answers.splunk.com/answers/397051/can-you-regex-or-wildcard-props-sourcetype-stanzas.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 13:30:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-use-wildcards-for-the-source-stanza-in-props-conf/m-p/201297#M39839</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2019-07-16T13:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use wildcards (*) for the source stanza in props.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-use-wildcards-for-the-source-stanza-in-props-conf/m-p/704714#M116568</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/15147"&gt;@somesoni2&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/24229"&gt;@lguinn2&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/107153"&gt;@landen99&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/196745"&gt;@jonatanjosefson&lt;/a&gt;&amp;nbsp;any solution on this? I want to specify source::mylog_*&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2024 11:30:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-use-wildcards-for-the-source-stanza-in-props-conf/m-p/704714#M116568</guid>
      <dc:creator>splunkreal</dc:creator>
      <dc:date>2024-11-19T11:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use wildcards (*) for the source stanza in props.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-use-wildcards-for-the-source-stanza-in-props-conf/m-p/704774#M116570</link>
      <description>&lt;P&gt;For the source stanza, Splunk uses&amp;nbsp;regular expressions that are PCRE (Perl Compatible Regular Expressions).&lt;/P&gt;&lt;P&gt;From &lt;STRONG&gt;props.conf.spec&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;**[source::&amp;lt;source&amp;gt;] and [host::&amp;lt;host&amp;gt;] stanza match language:**

Match expressions must match the entire name, not just a substring. Match
expressions are based on a full implementation of Perl-compatible regular
expressions (PCRE) with the translation of "...", "*", and "." Thus, "."
matches a period, "*" matches non-directory separators, and "..." matches
any number of any characters.&lt;/PRE&gt;&lt;P&gt;Also from &lt;STRONG&gt;props.conf.spec&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;When setting a [&amp;lt;spec&amp;gt;] stanza, you can use the following regex-type syntax:
... recurses through directories until the match is met
    or equivalently, matches any number of characters.
*   matches anything but the path separator 0 or more times.
    The path separator is '/' on unix, or '\' on Windows.
    Intended to match a partial or complete directory or filename.
|   is equivalent to 'or'
( ) are used to limit scope of |.
\\ = matches a literal backslash '\'.&lt;/PRE&gt;&lt;P&gt;So for &lt;STRONG&gt;mylog_*&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;you could specify&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;source::.../mylog_*&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;It's been a few years on this one, so hope I am right this time!&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2024 21:19:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-use-wildcards-for-the-source-stanza-in-props-conf/m-p/704774#M116570</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2024-11-19T21:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use wildcards (*) for the source stanza in props.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-use-wildcards-for-the-source-stanza-in-props-conf/m-p/704777#M116572</link>
      <description>&lt;P&gt;Let's try one last time!&lt;/P&gt;&lt;P&gt;In props.conf, the source stanza actually follows a modified regex syntax. (See my other comment from 19-nov-2024 or just read &lt;A href="https://docs.splunk.com/Documentation/Splunk/9.3.2/Admin/Propsconf#GLOBAL_SETTINGS" target="_self"&gt;props.conf.spec&lt;/A&gt;). So the following &lt;EM&gt;should&lt;/EM&gt; work&lt;/P&gt;&lt;PRE&gt;[source::/opt/splunk/var/log/syslog/*lx0001*/*]&lt;BR /&gt;or&amp;nbsp;perhaps&lt;BR /&gt;[source::/opt/splunk/var/log/syslog/*lx0001*/*.log]&lt;/PRE&gt;&lt;P&gt;But re-reading the original post,&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/196745"&gt;@jonatanjosefson&lt;/a&gt;&amp;nbsp;was actually trying to set some property for all syslog events corresponding to a particular host name pattern - you can do that using a host stanza instead of a source stanza:&lt;/P&gt;&lt;PRE&gt;host::*lx0001*&lt;/PRE&gt;&lt;P&gt;To me, this seems easier to understand and maintain, as it will work even if the directory structure of the syslog files changes over time. It depends only on the hostname, and not the file name or location.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2024 21:33:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-use-wildcards-for-the-source-stanza-in-props-conf/m-p/704777#M116572</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2024-11-19T21:33:54Z</dc:date>
    </item>
  </channel>
</rss>

