<?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: Is there a way to use rex to divide api name? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-use-rex-to-divide-api-name/m-p/624428#M217095</link>
    <description>&lt;P&gt;the search didnt give any results, also how do i get results of all the other companies like facebook, twitter?&lt;/P&gt;</description>
    <pubDate>Thu, 15 Dec 2022 18:21:12 GMT</pubDate>
    <dc:creator>mikeyty07</dc:creator>
    <dc:date>2022-12-15T18:21:12Z</dc:date>
    <item>
      <title>Is there a way to use rex to divide api name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-use-rex-to-divide-api-name/m-p/624284#M217052</link>
      <description>&lt;P&gt;I have an access logs which prints like this&lt;BR /&gt;&lt;SPAN class=""&gt;server&lt;/SPAN&gt; &lt;SPAN class=""&gt;-&lt;/SPAN&gt; &lt;SPAN class=""&gt;-&lt;/SPAN&gt;&lt;SPAN&gt; [date&amp;amp; time&lt;/SPAN&gt;&lt;SPAN&gt;] "&lt;/SPAN&gt;&lt;SPAN class=""&gt;GET&lt;/SPAN&gt; &lt;SPAN class=""&gt;/google/page1/page1a/633243463476/googlep1&lt;/SPAN&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;SPAN class=""&gt;sc=RT&lt;/SPAN&gt;&lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;lo=en_US&lt;/SPAN&gt; &lt;SPAN class=""&gt;HTTP/1.1&lt;/SPAN&gt;&lt;SPAN&gt;" &lt;/SPAN&gt;&lt;SPAN class=""&gt;200&lt;/SPAN&gt; &lt;SPAN class=""&gt;350&lt;/SPAN&gt; &lt;SPAN class=""&gt;85&lt;BR /&gt;&lt;/SPAN&gt;which rex is&amp;nbsp;&lt;BR /&gt;| rex field=_raw "(?&amp;lt;SRC&amp;gt;\d+\.\d+\.\d+\.\d+).+\]\s\"(?&amp;lt;http_method&amp;gt;\w+)\s(?&amp;lt;uri_path&amp;gt;\S+)\s(?&amp;lt;uri_query&amp;gt;\S+)\"\s(?&amp;lt;statusCode&amp;gt;\d+)\s(?&amp;lt;body_size&amp;gt;\d+)\s\s(?&amp;lt;response_time&amp;gt;\d+)"&lt;/P&gt;
&lt;P&gt;Is there a way to seperate uri into two or 3?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;SPAN class=""&gt;/google/page1/page1a/633243463476/googlep1&lt;/SPAN&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;SPAN class=""&gt;sc=RT&lt;/SPAN&gt;&lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;lo=en_US&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;TO&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;/google&lt;BR /&gt;/page1/page1a/633243463476/googlep1&lt;SPAN&gt;?&lt;/SPAN&gt;sc=RT&lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt;lo=en_US&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;OR&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;/google&lt;BR /&gt;/page1/page1a/633243463476/googlep1&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;SPAN&gt;sc=RT&lt;/SPAN&gt;&lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt;&lt;SPAN&gt;lo=en_US&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2022 01:06:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-use-rex-to-divide-api-name/m-p/624284#M217052</guid>
      <dc:creator>mikeyty07</dc:creator>
      <dc:date>2022-12-15T01:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: Using rex to divide api name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-use-rex-to-divide-api-name/m-p/624296#M217057</link>
      <description>&lt;P&gt;This will get the 3 parts&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(?&amp;lt;uri_root&amp;gt;/[^/]+)(?&amp;lt;uri_path&amp;gt;[^?\s]+)\s?(?&amp;lt;uri_query&amp;gt;\S+)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 14 Dec 2022 23:09:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-use-rex-to-divide-api-name/m-p/624296#M217057</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-12-14T23:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to use rex to divide api name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-use-rex-to-divide-api-name/m-p/624347#M217078</link>
      <description>&lt;P&gt;An alternative to regex is to use &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/MultivalueEvalFunctions#split.28X.2C.22Y.22.29" target="_blank" rel="noopener"&gt;split&lt;/A&gt;, which can be more semantically explicit. (And slightly more efficient.)&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now to using split. &amp;nbsp;Assuming that you have that field uri.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval uri = split(uri, "?")
| eval uri_query = "?" . mvindex(uri, 1) ``` ?sc=RT&amp;amp;lo=en_US ```
| eval uri = split(mvindex(uri, 0), "/")
| eval root = "/" . mvindex(uri, 1) ``` /google ```
| eval remainder = "/" . mvjoin(mvindex(uri, 2, -1), "/")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This gives&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;remainder&lt;/TD&gt;&lt;TD&gt;root&lt;/TD&gt;&lt;TD&gt;uri_query&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;/page1/page1a/633243463476/googlep1&lt;/TD&gt;&lt;TD&gt;/google&lt;/TD&gt;&lt;TD&gt;?sc=RT&amp;amp;lo=en_US&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2022 10:54:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-use-rex-to-divide-api-name/m-p/624347#M217078</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-12-15T10:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to use rex to divide api name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-use-rex-to-divide-api-name/m-p/624428#M217095</link>
      <description>&lt;P&gt;the search didnt give any results, also how do i get results of all the other companies like facebook, twitter?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2022 18:21:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-use-rex-to-divide-api-name/m-p/624428#M217095</guid>
      <dc:creator>mikeyty07</dc:creator>
      <dc:date>2022-12-15T18:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to use rex to divide api name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-use-rex-to-divide-api-name/m-p/624456#M217106</link>
      <description>&lt;P&gt;Thank you worked like a charm, however i used&lt;BR /&gt;(?&amp;lt;uri_root&amp;gt;/[^/]+)(?&amp;lt;uri_path&amp;gt;[^?\s]+)\s(?&amp;lt;uri_query&amp;gt;\S+)&lt;BR /&gt;uri_query seemed to give results for Http/1.1&lt;BR /&gt;&lt;BR /&gt;can you also please check this? It is follow up question.&lt;BR /&gt;&lt;A href="https://community.splunk.com/t5/Splunk-Search/Using-lookup-command-after-rex-field/td-p/624450" target="_blank"&gt;https://community.splunk.com/t5/Splunk-Search/Using-lookup-command-after-rex-field/td-p/624450&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2022 20:08:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-use-rex-to-divide-api-name/m-p/624456#M217106</guid>
      <dc:creator>mikeyty07</dc:creator>
      <dc:date>2022-12-15T20:08:52Z</dc:date>
    </item>
  </channel>
</rss>

