<?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: Regex search on server side in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-search-on-server-side/m-p/56335#M13782</link>
    <description>&lt;P&gt;They is no documentation on the location of each search, it depends of the order.&lt;/P&gt;

&lt;P&gt;Statistical commands can run on the search-peer and be combined in the search-head. Initial rex filters can apply on the search-peers, but rex applied on result of search results will be applied on the search-head of course&lt;/P&gt;

&lt;P&gt;example :&lt;BR /&gt;
&lt;CODE&gt;mysearch terms  -&amp;gt; on search-peers&lt;BR /&gt;
| rex  field=_raw  to populate fieldA -&amp;gt; on search-peer  &lt;BR /&gt;
| stats count latest(_raw) AS fieldB by fieldA -&amp;gt; apply on search-peer and is consolidated on search-head &lt;BR /&gt;
| rex field=fieldB  to populate fieldC -&amp;gt; search-head&lt;BR /&gt;
| stats sum(fieldC )  by fieldA -&amp;gt; search-head&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The search inspector can show you how long it took per indexer, and the overall cost per search component. but not the details you are asking.&lt;/P&gt;</description>
    <pubDate>Wed, 05 Jun 2013 23:42:17 GMT</pubDate>
    <dc:creator>yannK</dc:creator>
    <dc:date>2013-06-05T23:42:17Z</dc:date>
    <item>
      <title>Regex search on server side</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-search-on-server-side/m-p/56331#M13778</link>
      <description>&lt;P&gt;from my understanding | rex ... does the search on client side. is there a way to specify a regex search string on the search head instead to improve performance?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2013 20:53:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-search-on-server-side/m-p/56331#M13778</guid>
      <dc:creator>leecaf</dc:creator>
      <dc:date>2013-06-05T20:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: Regex search on server side</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-search-on-server-side/m-p/56332#M13779</link>
      <description>&lt;P&gt;The |rex... command will actually be executed at search time. &lt;/P&gt;

&lt;P&gt;This means that using the rex command on the search head should do the parsing on the search head. If you need to do it on the indexer (not recommended) then you can use the props.conf and transforms.conf files to set up regex extractions at index time.&lt;/P&gt;

&lt;P&gt;Take a look at the following documentation:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.2/Indexer/Indextimeversussearchtime"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.2/Indexer/Indextimeversussearchtime&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.2/Search/Extractfieldswithsearchcommands"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.2/Search/Extractfieldswithsearchcommands&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2013 21:01:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-search-on-server-side/m-p/56332#M13779</guid>
      <dc:creator>Rob</dc:creator>
      <dc:date>2013-06-05T21:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Regex search on server side</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-search-on-server-side/m-p/56333#M13780</link>
      <description>&lt;P&gt;thanks, is there a list of which piped commands are executed on search head ( presumably on if piped right after the first search string ) and which on the client? better yet is there a way to get transparency into which part of my query is being executed where?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2013 21:11:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-search-on-server-side/m-p/56333#M13780</guid>
      <dc:creator>leecaf</dc:creator>
      <dc:date>2013-06-05T21:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: Regex search on server side</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-search-on-server-side/m-p/56334#M13781</link>
      <description>&lt;P&gt;What do you mean by "client"? In my world "client" would refer to your own machine that you're using to access Splunk. Nothing in Splunk's searching is done client-side in that sense.&lt;/P&gt;

&lt;P&gt;If you mean "client" = "search peer", i.e. an indexer that the search head issues searches to, then generally you'd want to look at the map/reduce model used by Splunk and which commands are considered to be of "map" type and which ones are considered to be of the "reduce" type. Sadly this is not documented anywhere (that I know of) but you can get pretty far by using common sense. The thing is, when a search head issues a search to its search peers, all parts of the search up until the first command of "reduce" type will run on the search peers. A "reduce" operation is one that requires data from the search peers to be combined in some way and hence cannot be parallellized anymore, so the search peer has to gather all data from its peers and do the rest of the search itself. So say you have something like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search ... | rex ... | lookup ... | stats ... | eval ... | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;All commands up until &lt;CODE&gt;stats&lt;/CODE&gt; are "map" type commands, or perhaps it's easier here to say that they're at least not "reduce". So, the first 3 (&lt;CODE&gt;search&lt;/CODE&gt;, &lt;CODE&gt;rex&lt;/CODE&gt; and &lt;CODE&gt;lookup&lt;/CODE&gt;) will run on each search peer before &lt;CODE&gt;stats&lt;/CODE&gt; causes the search head to gather the data from its peers. &lt;CODE&gt;eval&lt;/CODE&gt; and the rest of the search will be run on the search head.&lt;/P&gt;

&lt;P&gt;This is important to keep track of in situations where you want a search to scale as optimally as possible, like your &lt;CODE&gt;rex&lt;/CODE&gt; example though I think you really would need a &lt;EM&gt;very&lt;/EM&gt; resource intensive regex to really make a difference where it runs. It is also important when you have things like dynamic lookups that will yield different results based on where they run.&lt;/P&gt;

&lt;P&gt;Again, there's no documentation on this but you can guess which commands would force the search head to gather data. All types of commands that aggregate data in one way or another need a complete set of data to work on, and all types of commands that just do some sort of event-by-event mapping or transformation typically do not need this. I hope you get the idea.&lt;/P&gt;

&lt;P&gt;...that is, if I'm interpreting what you really mean by your question. I might be answering to a completely different question than what you're asking &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2013 22:00:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-search-on-server-side/m-p/56334#M13781</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-06-05T22:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Regex search on server side</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-search-on-server-side/m-p/56335#M13782</link>
      <description>&lt;P&gt;They is no documentation on the location of each search, it depends of the order.&lt;/P&gt;

&lt;P&gt;Statistical commands can run on the search-peer and be combined in the search-head. Initial rex filters can apply on the search-peers, but rex applied on result of search results will be applied on the search-head of course&lt;/P&gt;

&lt;P&gt;example :&lt;BR /&gt;
&lt;CODE&gt;mysearch terms  -&amp;gt; on search-peers&lt;BR /&gt;
| rex  field=_raw  to populate fieldA -&amp;gt; on search-peer  &lt;BR /&gt;
| stats count latest(_raw) AS fieldB by fieldA -&amp;gt; apply on search-peer and is consolidated on search-head &lt;BR /&gt;
| rex field=fieldB  to populate fieldC -&amp;gt; search-head&lt;BR /&gt;
| stats sum(fieldC )  by fieldA -&amp;gt; search-head&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The search inspector can show you how long it took per indexer, and the overall cost per search component. but not the details you are asking.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2013 23:42:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-search-on-server-side/m-p/56335#M13782</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2013-06-05T23:42:17Z</dc:date>
    </item>
  </channel>
</rss>

