<?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 append/concatenate regexes for one field check? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-append-concatenate-regexes-for-one-field-check/m-p/457858#M129301</link>
    <description>&lt;P&gt;Currently I have a search as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;myFieldName="mySearchValue" | where match(path,`startOfPath`)
`startOfPath` expands to f.e. "^C\:\\\Windows\\\.*"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Some cases, however, I'd need to specify additional paths. In order to avoid to have a lot of repetition, my question was whether it was possible to use &lt;CODE&gt;startOfPath&lt;/CODE&gt; + rest of path to validate the path.&lt;/P&gt;

&lt;P&gt;As requested by mydog8it I'll elaborate with a concrete example of what I'm trying to accomplish.&lt;/P&gt;

&lt;P&gt;macro 1 : filter_CLIENT_CONTROL&lt;BR /&gt;
&lt;CODE&gt;ThreatName="Client Control" | where match(SourcePath,`path_windows` + CustomRestOfPath)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;macro 2 : path_windows&lt;BR /&gt;
&lt;CODE&gt;"^C\:\\\Windows\\\.*"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Whilst what I'm trying to accomplish is as follows for the filter_CLIENT_CONTROL macro:&lt;BR /&gt;
&lt;CODE&gt;ThreatName="Client Control" | where match(SourcePath,`path_windows` + ".*\\(COMPATTELRUNNER)\.EXE" ")&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;So in essence, the regex within the  &lt;CODE&gt;filter_CLIENT_CONTROL&lt;/CODE&gt; macro expands to  &lt;CODE&gt;^C\:\\(WINDOWS)\\.*\\(COMPATTELRUNNER)\.EXE&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 23:50:01 GMT</pubDate>
    <dc:creator>hexerino</dc:creator>
    <dc:date>2020-09-29T23:50:01Z</dc:date>
    <item>
      <title>Is it possible to append/concatenate regexes for one field check?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-append-concatenate-regexes-for-one-field-check/m-p/457858#M129301</link>
      <description>&lt;P&gt;Currently I have a search as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;myFieldName="mySearchValue" | where match(path,`startOfPath`)
`startOfPath` expands to f.e. "^C\:\\\Windows\\\.*"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Some cases, however, I'd need to specify additional paths. In order to avoid to have a lot of repetition, my question was whether it was possible to use &lt;CODE&gt;startOfPath&lt;/CODE&gt; + rest of path to validate the path.&lt;/P&gt;

&lt;P&gt;As requested by mydog8it I'll elaborate with a concrete example of what I'm trying to accomplish.&lt;/P&gt;

&lt;P&gt;macro 1 : filter_CLIENT_CONTROL&lt;BR /&gt;
&lt;CODE&gt;ThreatName="Client Control" | where match(SourcePath,`path_windows` + CustomRestOfPath)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;macro 2 : path_windows&lt;BR /&gt;
&lt;CODE&gt;"^C\:\\\Windows\\\.*"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Whilst what I'm trying to accomplish is as follows for the filter_CLIENT_CONTROL macro:&lt;BR /&gt;
&lt;CODE&gt;ThreatName="Client Control" | where match(SourcePath,`path_windows` + ".*\\(COMPATTELRUNNER)\.EXE" ")&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;So in essence, the regex within the  &lt;CODE&gt;filter_CLIENT_CONTROL&lt;/CODE&gt; macro expands to  &lt;CODE&gt;^C\:\\(WINDOWS)\\.*\\(COMPATTELRUNNER)\.EXE&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:50:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-append-concatenate-regexes-for-one-field-check/m-p/457858#M129301</guid>
      <dc:creator>hexerino</dc:creator>
      <dc:date>2020-09-29T23:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to append/concatenate regexes for one field check?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-append-concatenate-regexes-for-one-field-check/m-p/457859#M129302</link>
      <description>&lt;P&gt;Can you provide example data and an example of how you would like it parsed? It sounds to me like you could just use two capture groups with the names "startOfPath" and another named "restOfPath". &lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 13:04:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-append-concatenate-regexes-for-one-field-check/m-p/457859#M129302</guid>
      <dc:creator>mydog8it</dc:creator>
      <dc:date>2019-03-28T13:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to append/concatenate regexes for one field check?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-append-concatenate-regexes-for-one-field-check/m-p/457860#M129303</link>
      <description>&lt;P&gt;After having provided information but not having received any feedback I solved the problem through an alternative approach.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 10:04:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-append-concatenate-regexes-for-one-field-check/m-p/457860#M129303</guid>
      <dc:creator>hexerino</dc:creator>
      <dc:date>2019-04-17T10:04:52Z</dc:date>
    </item>
  </channel>
</rss>

