<?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: AND | OR Rex field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/AND-OR-Rex-field/m-p/223744#M176616</link>
    <description>&lt;P&gt;Even better. Perfect, thank you very much.&lt;/P&gt;</description>
    <pubDate>Thu, 29 Sep 2016 18:39:36 GMT</pubDate>
    <dc:creator>patelpin</dc:creator>
    <dc:date>2016-09-29T18:39:36Z</dc:date>
    <item>
      <title>AND | OR Rex field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/AND-OR-Rex-field/m-p/223738#M176610</link>
      <description>&lt;P&gt;Hello. I have a few servers: a,b,c and 1,2,3&lt;/P&gt;

&lt;P&gt;Servers a,b,c work with this -   &lt;CODE&gt;&lt;FONT color="green"&gt; base search | rex field=cs_uri_stem "(\/apps\/)(?P&amp;lt; test&amp;gt;[\d\w]+)(\/\w+)(.*\b\w+)$" | top limit=1000 test&lt;/FONT&gt;&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;cs_uri_stem= /apps/example/foo.aspx&lt;BR /&gt;
some of the cs_uri_stem will be /apps/example/example/foo.aspx&lt;/P&gt;

&lt;P&gt;Servers 1,2,3 work with this -   &lt;CODE&gt;&lt;FONT color="green"&gt; base search | rex field=cs_uri_stem "(\/apps\/)|(?P&amp;lt; test&amp;gt;[\d\w]+)(\/\w+)(.*\b\w+)$" | top limit=1000 test&lt;/FONT&gt;&lt;/CODE&gt;&lt;BR /&gt;
cs_uri_stem= /example/foo.aspx&lt;/P&gt;

&lt;P&gt;I would like to combine them so that I get the results from all the servers. Please excuse the space in &amp;lt; test&amp;gt; it wouldn't show without the space.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:13:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/AND-OR-Rex-field/m-p/223738#M176610</guid>
      <dc:creator>patelpin</dc:creator>
      <dc:date>2020-09-29T11:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: AND | OR Rex field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/AND-OR-Rex-field/m-p/223739#M176611</link>
      <description>&lt;P&gt;Can you please provide some real world sample data as text?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2016 20:14:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/AND-OR-Rex-field/m-p/223739#M176611</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2016-09-27T20:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: AND | OR Rex field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/AND-OR-Rex-field/m-p/223740#M176612</link>
      <description>&lt;P&gt;I can post the cs_uri_stem from several of the servers. In bold is what I'm trying to extract. Let me know if you need additional items. Not sure I'm giving everything you need. I can give full raw if you'd like. The only difference between the two is the | pipe.&lt;/P&gt;

&lt;P&gt;Servers a,b,c:&lt;BR /&gt;
/apps/&lt;STRONG&gt;spxss&lt;/STRONG&gt;/spxquotebrowser/SPX.css&lt;BR /&gt;
/apps/&lt;STRONG&gt;ajt&lt;/STRONG&gt;/SE3SPX2COM/Spx2COM.asmx&lt;BR /&gt;
/apps/&lt;STRONG&gt;PriceInq&lt;/STRONG&gt;/Default.aspx&lt;BR /&gt;
/apps/&lt;STRONG&gt;ordp&lt;/STRONG&gt;/OrderEntry.aspx&lt;BR /&gt;
/apps/&lt;STRONG&gt;orderalert&lt;/STRONG&gt;/default.aspx&lt;BR /&gt;
/apps/&lt;STRONG&gt;ALIS&lt;/STRONG&gt;/ALIC.aspx&lt;/P&gt;

&lt;P&gt;Servers 1,2,3:&lt;BR /&gt;
/&lt;STRONG&gt;ECFPO&lt;/STRONG&gt;/OpenPO.aspx&lt;BR /&gt;
/&lt;STRONG&gt;ECFBWIN&lt;/STRONG&gt;/Reserved.ReportViewerWebControl.axd&lt;BR /&gt;
/&lt;STRONG&gt;open4ess&lt;/STRONG&gt;/checks1.asp&lt;BR /&gt;
/&lt;STRONG&gt;ecfordertracker&lt;/STRONG&gt;/&lt;BR /&gt;
/&lt;STRONG&gt;ECFQuoteTracker&lt;/STRONG&gt;/QuoteCompleted.aspx&lt;/P&gt;

&lt;P&gt;sourcetype=iis s_computername=Server1*  | rex field=cs_uri_stem "(\/apps\/)(?P&amp;lt; test&amp;gt;[\d\w]+)(\/\w+)(.*\b\w+)$" | top limit=1000 test&lt;BR /&gt;
Will give me:&lt;BR /&gt;
spxss&lt;BR /&gt;
ajt&lt;BR /&gt;
PriceInq&lt;BR /&gt;
ordp&lt;BR /&gt;
orderalert&lt;BR /&gt;
ALIS&lt;/P&gt;

&lt;P&gt;sourcetype=iis s_computername=ServerA*  | rex field=cs_uri_stem "(\/apps\/)|(?P&amp;lt; test&amp;gt;[\d\w]+)(\/\w+)(.*\b\w+)$" | top limit=1000 test&lt;BR /&gt;
Will give me:&lt;BR /&gt;
ECFPO&lt;BR /&gt;
ECFBWIN&lt;BR /&gt;
open4ess&lt;BR /&gt;
ecfordertracker&lt;BR /&gt;
ECFQuoteTracker&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:13:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/AND-OR-Rex-field/m-p/223740#M176612</guid>
      <dc:creator>patelpin</dc:creator>
      <dc:date>2020-09-29T11:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: AND | OR Rex field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/AND-OR-Rex-field/m-p/223741#M176613</link>
      <description>&lt;P&gt;Hi patelpin,&lt;/P&gt;

&lt;P&gt;based on the provided examples this regex should work for you:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=cs_uri_stem "(^\/apps\/|^\/(?!apps))(?&amp;lt;myFoo&amp;gt;[^\/]+)" | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Tested and working on regex101.com&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2016 21:45:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/AND-OR-Rex-field/m-p/223741#M176613</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2016-09-27T21:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: AND | OR Rex field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/AND-OR-Rex-field/m-p/223742#M176614</link>
      <description>&lt;P&gt;This worked exactly as I'd hoped, for about 99% of all the items. There are just a few cs_uri_stem that are like /example.gif, favicon.ico and the such. Is there any way to exclude these items?&lt;/P&gt;

&lt;P&gt;At the moment, in my queries I can just use ... | search myFoo!="&lt;EM&gt;.&lt;/EM&gt;" | ...&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:13:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/AND-OR-Rex-field/m-p/223742#M176614</guid>
      <dc:creator>patelpin</dc:creator>
      <dc:date>2020-09-29T11:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: AND | OR Rex field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/AND-OR-Rex-field/m-p/223743#M176615</link>
      <description>&lt;P&gt;Sure, just add another &lt;CODE&gt;\/&lt;/CODE&gt; at the end to make sure it will only match if there is a second &lt;CODE&gt;/&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... | rex field=cs_uri_stem "(^\/apps\/|^\/(?!apps))(?&amp;lt;myFoo&amp;gt;\w+)\/" | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2016 19:19:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/AND-OR-Rex-field/m-p/223743#M176615</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2016-09-28T19:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: AND | OR Rex field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/AND-OR-Rex-field/m-p/223744#M176616</link>
      <description>&lt;P&gt;Even better. Perfect, thank you very much.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2016 18:39:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/AND-OR-Rex-field/m-p/223744#M176616</guid>
      <dc:creator>patelpin</dc:creator>
      <dc:date>2016-09-29T18:39:36Z</dc:date>
    </item>
  </channel>
</rss>

