<?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 props.conf - Issue with [&amp;lt;spec&amp;gt;] regex-like syntax in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/props-conf-Issue-with-lt-spec-gt-regex-like-syntax/m-p/650632#M110552</link>
    <description>&lt;P&gt;&lt;FONT face="helvetica"&gt;I'm trying to specify a single stanza in props.conf, with FIELDALIAS and EVAL expressions, for two different sourcetypes, "Snare:Security" and "XmlWinEventLog". However, when I use an OR pipe to specify both sourcetypes in the [&amp;lt;spec&amp;gt;], like so:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;[Snare:Security|XmlWinEventLog]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="helvetica"&gt;neither sourcetype has the rules applied to it. Inspecting "source types" in my search head shows that the rules have been applied to the sourcetype "Snare:Security|XmlWinEventLog", instead of both the individual sourcetypes.&lt;BR /&gt;&lt;BR /&gt;Am I not using the pipe correctly? Per the splunk documentation:&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;**[&amp;lt;spec&amp;gt;] stanza patterns:**&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;When setting a [&amp;lt;spec&amp;gt;] stanza, you can use the following regex-type syntax:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;... recurses through directories until the match is met&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;or equivalently, matches any number of characters.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;* matches anything but the path separator 0 or more times.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;The path separator is '/' on unix, or '\' on Windows.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Intended to match a partial or complete directory or filename.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| is equivalent to 'or'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;( ) are used to limit scope of |.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;\\ = matches a literal backslash '\'.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;It seems like it should work. I've tried placing parenthesis around the whole expression and around each individual sourcetype.&lt;/P&gt;</description>
    <pubDate>Fri, 14 Jul 2023 19:46:43 GMT</pubDate>
    <dc:creator>SplunkMan96</dc:creator>
    <dc:date>2023-07-14T19:46:43Z</dc:date>
    <item>
      <title>props.conf - Issue with [&lt;spec&gt;] regex-like syntax</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/props-conf-Issue-with-lt-spec-gt-regex-like-syntax/m-p/650632#M110552</link>
      <description>&lt;P&gt;&lt;FONT face="helvetica"&gt;I'm trying to specify a single stanza in props.conf, with FIELDALIAS and EVAL expressions, for two different sourcetypes, "Snare:Security" and "XmlWinEventLog". However, when I use an OR pipe to specify both sourcetypes in the [&amp;lt;spec&amp;gt;], like so:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;[Snare:Security|XmlWinEventLog]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="helvetica"&gt;neither sourcetype has the rules applied to it. Inspecting "source types" in my search head shows that the rules have been applied to the sourcetype "Snare:Security|XmlWinEventLog", instead of both the individual sourcetypes.&lt;BR /&gt;&lt;BR /&gt;Am I not using the pipe correctly? Per the splunk documentation:&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;**[&amp;lt;spec&amp;gt;] stanza patterns:**&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;When setting a [&amp;lt;spec&amp;gt;] stanza, you can use the following regex-type syntax:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;... recurses through directories until the match is met&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;or equivalently, matches any number of characters.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;* matches anything but the path separator 0 or more times.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;The path separator is '/' on unix, or '\' on Windows.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Intended to match a partial or complete directory or filename.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| is equivalent to 'or'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;( ) are used to limit scope of |.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;\\ = matches a literal backslash '\'.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;It seems like it should work. I've tried placing parenthesis around the whole expression and around each individual sourcetype.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 19:46:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/props-conf-Issue-with-lt-spec-gt-regex-like-syntax/m-p/650632#M110552</guid>
      <dc:creator>SplunkMan96</dc:creator>
      <dc:date>2023-07-14T19:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: props.conf - Issue with [&lt;spec&gt;] regex-like syntax</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/props-conf-Issue-with-lt-spec-gt-regex-like-syntax/m-p/650634#M110553</link>
      <description>&lt;P&gt;If two sourcetypes use the exact same settings then perhaps they should be a single sourcetype.&amp;nbsp; Also, copying lines to make another sourcetype takes less effort than you've expended so far.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I've never seen anyone use a regular expression in a props.conf stanza, but it does work in inputs.conf so should work in props.conf.&amp;nbsp; The catch is the regex engine is only invoked when a wildcard is detected.&amp;nbsp; I believe that is not documented.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 19:54:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/props-conf-Issue-with-lt-spec-gt-regex-like-syntax/m-p/650634#M110553</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-07-14T19:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: props.conf - Issue with [&lt;spec&gt;] regex-like syntax</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/props-conf-Issue-with-lt-spec-gt-regex-like-syntax/m-p/650638#M110555</link>
      <description>&lt;P&gt;Just look inside Splunk_TA_windows &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;[(?::){0}WinEventLog:*]&lt;BR /&gt;TRANSFORMS-Fixup = ta-windows-fix-classic-source,ta-windows-fix-sourcetype&lt;BR /&gt;&lt;BR /&gt;[(?::){0}XmlWinEventLog:*]&lt;BR /&gt;TRANSFORMS-XmlFixup = ta-windows-fix-xml-source,ta-windows-fix-sourcetype&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 20:12:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/props-conf-Issue-with-lt-spec-gt-regex-like-syntax/m-p/650638#M110555</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-07-14T20:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: props.conf - Issue with [&lt;spec&gt;] regex-like syntax</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/props-conf-Issue-with-lt-spec-gt-regex-like-syntax/m-p/650640#M110556</link>
      <description>&lt;P&gt;This works, thanks! Using&amp;nbsp;&lt;FONT face="courier new,courier"&gt;[(?::){0}Snare:Security|XmlWinEventLog]&lt;/FONT&gt;as the stanza specifier applies the rules to both sourcetypes.&lt;BR /&gt;&lt;BR /&gt;In response to the original reply, I would combine the sourcetypes, but they do have meaningfully different formats. As you can see, some come direct from Windows machines in XML format and some are forwarded over syslog using Snare, and have been converted to TSV format. I've translated fields into CIM format for each case, but the raw text still differs, so I feel the sourcetype should as well. I could, of course, copy the same text to two stanzas, but in my opinion that's pretty messy.&lt;BR /&gt;&lt;BR /&gt;I tried adding wildcards to the sourcetype, but it doesn't work as intended. This isn't intended to be actual regex, but the regex-like syntax encompassing those four operators (&lt;FONT face="courier new,courier"&gt;..., *, |, ()&lt;/FONT&gt;) specified in Splunk's props.conf definition.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 20:23:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/props-conf-Issue-with-lt-spec-gt-regex-like-syntax/m-p/650640#M110556</guid>
      <dc:creator>SplunkMan96</dc:creator>
      <dc:date>2023-07-14T20:23:56Z</dc:date>
    </item>
  </channel>
</rss>

