<?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: Large number of regular expressions in search field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Large-number-of-regular-expressions-in-search-field/m-p/66494#M16553</link>
    <description>&lt;P&gt;you might also find this website as a useful tool for regex&lt;/P&gt;

&lt;P&gt;&lt;A href="http://gskinner.com/RegExr/"&gt;http://gskinner.com/RegExr/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Dec 2012 23:59:52 GMT</pubDate>
    <dc:creator>GKC</dc:creator>
    <dc:date>2012-12-18T23:59:52Z</dc:date>
    <item>
      <title>Large number of regular expressions in search field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Large-number-of-regular-expressions-in-search-field/m-p/66491#M16550</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I am a new Splunk user and at the moment I am using it to monitor the performance of the web applications of the insurance company that I work for. I want to be able to generate a report that shows the average response time against each web request as well as the number of instances of that request that were submitted for a given time period. A large number of the web requests have dynamic values in them for customer id, policy number, claim id, repair booking etc. I am using regular expressions to filter out the unique info and group the request together. So at the moment I have a search that looks like the following ..&lt;/P&gt;

&lt;P&gt;index=arena_repairs_prod responseTime&amp;gt;5000  lodge | rex field=uri_path mode=sed "s/repair\/summary.html\?repairId=[0-9]+/repair\/summary.html?repairId=/" | rex field=uri_path mode=sed ....&lt;/P&gt;

&lt;P&gt;So I just keep repeating the regular expressions one after the other in the search field. I can see that my search is going to become quite large. &lt;/P&gt;

&lt;P&gt;Is this the best way to create a search like this, or is there someone of saving each of the regular expressions and just referring to them by a variable name?&lt;/P&gt;

&lt;P&gt;Any advice would be much appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:58:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Large-number-of-regular-expressions-in-search-field/m-p/66491#M16550</guid>
      <dc:creator>tamnor</dc:creator>
      <dc:date>2020-09-28T12:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: Large number of regular expressions in search field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Large-number-of-regular-expressions-in-search-field/m-p/66492#M16551</link>
      <description>&lt;P&gt;It would be better not to mess with the raw data but instead extract the endpoints you're interested in as fields and then group by that. So instead of&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... | rex field=uri_path mode=sed "s/repair\/summary.html?repairId=[0-9]+/repair\/summary.html?repairId=/"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Couldn't you just check all requests to summary.html?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=uri_path "^(?&amp;lt;requestedPage&amp;gt;[^?]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Dec 2012 08:45:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Large-number-of-regular-expressions-in-search-field/m-p/66492#M16551</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-12-18T08:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: Large number of regular expressions in search field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Large-number-of-regular-expressions-in-search-field/m-p/66493#M16552</link>
      <description>&lt;P&gt;There is a way to save regular expressions to have fields extracted automatically each time you search, without cluttering your query. You can use the interactive field extractor, or create extractions/transformations yourself.&lt;/P&gt;

&lt;P&gt;IFX how-to: &lt;A href="http://www.splunk.com/view/SP-CAAADUY"&gt;http://www.splunk.com/view/SP-CAAADUY&lt;/A&gt;&lt;BR /&gt;
Field extraction in general: &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0/Knowledge/Aboutfields"&gt;http://docs.splunk.com/Documentation/Splunk/5.0/Knowledge/Aboutfields&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2012 12:10:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Large-number-of-regular-expressions-in-search-field/m-p/66493#M16552</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2012-12-18T12:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: Large number of regular expressions in search field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Large-number-of-regular-expressions-in-search-field/m-p/66494#M16553</link>
      <description>&lt;P&gt;you might also find this website as a useful tool for regex&lt;/P&gt;

&lt;P&gt;&lt;A href="http://gskinner.com/RegExr/"&gt;http://gskinner.com/RegExr/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2012 23:59:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Large-number-of-regular-expressions-in-search-field/m-p/66494#M16553</guid>
      <dc:creator>GKC</dc:creator>
      <dc:date>2012-12-18T23:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: Large number of regular expressions in search field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Large-number-of-regular-expressions-in-search-field/m-p/66495#M16554</link>
      <description>&lt;P&gt;Hi. Thanks for the responses. This is no longer a problem as the indexing was changed so that the uri_path is an extracted field so I can group by this rather than the full url with all the dynamic values. There are still some dynamic values in the uri_path but not that many so my queries aren't too long.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:07:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Large-number-of-regular-expressions-in-search-field/m-p/66495#M16554</guid>
      <dc:creator>tamnor</dc:creator>
      <dc:date>2020-09-28T13:07:02Z</dc:date>
    </item>
  </channel>
</rss>

