<?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: What rex to use for the extraction of virtual from URI? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/What-rex-to-use-for-the-extraction-of-virtual-from-URI/m-p/620803#M215791</link>
    <description>&lt;P&gt;This should do it.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "\/(?&amp;lt;field1&amp;gt;[^\/]+)"
| eval field1=if(isnull(field1) OR field1="","root", field1)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp; The &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt; command grabs everything between the first two slashes.&amp;nbsp; The &lt;FONT face="courier new,courier"&gt;eval&lt;/FONT&gt; command presumes a missing or empty field1 means the root was specified.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Nov 2022 21:29:23 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2022-11-14T21:29:23Z</dc:date>
    <item>
      <title>What rex to use for the extraction of virtual from URI?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-rex-to-use-for-the-extraction-of-virtual-from-URI/m-p/620784#M215788</link>
      <description>&lt;P&gt;These two cells are examples of results I see in IIs logs.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the field is just a &lt;STRONG&gt;/ &lt;/STRONG&gt;(backslash)&amp;nbsp;( as in the first example data cell )&amp;nbsp;I want to return just the /.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there are characters after the first / (like search in #2) , I need to return the text between the backslashes.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;/&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;/&lt;STRONG&gt;search&lt;/STRONG&gt;/20191108/master.svc&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My results would look like this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;field1&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;root&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;search&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 18:52:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-rex-to-use-for-the-extraction-of-virtual-from-URI/m-p/620784#M215788</guid>
      <dc:creator>lbonnes</dc:creator>
      <dc:date>2022-11-14T18:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: What rex to use for the extraction of virtual from URI?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-rex-to-use-for-the-extraction-of-virtual-from-URI/m-p/620803#M215791</link>
      <description>&lt;P&gt;This should do it.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "\/(?&amp;lt;field1&amp;gt;[^\/]+)"
| eval field1=if(isnull(field1) OR field1="","root", field1)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp; The &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt; command grabs everything between the first two slashes.&amp;nbsp; The &lt;FONT face="courier new,courier"&gt;eval&lt;/FONT&gt; command presumes a missing or empty field1 means the root was specified.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 21:29:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-rex-to-use-for-the-extraction-of-virtual-from-URI/m-p/620803#M215791</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-11-14T21:29:23Z</dc:date>
    </item>
  </channel>
</rss>

