<?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: How to extract data using rex ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/680753#M232672</link>
    <description>&lt;P&gt;Or better, do not use regex because the URI has an inherent structure/convention that many APIs adhere to. (See, e.g., &lt;A href="https://community.splunk.com/t5/Getting-Data-In/How-do-I-modify-my-rex-command-to-remove-directory-location-from/m-p/679687#M113580" target="_blank"&gt;Re: How do I modify my rex command to remove direc...&lt;/A&gt;)&amp;nbsp; What you ask is the second to last segment of HTTP_PATH variable in CGI standard.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval actionID = mvindex(split(httpURL, "/"), -2)&lt;/LI-CODE&gt;&lt;P&gt;Semantic code is easier to maintain and in this case, potentially cheaper than regex.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Mar 2024 20:46:15 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2024-03-14T20:46:15Z</dc:date>
    <item>
      <title>How to extract data using rex ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/680723#M232664</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want to extract value&amp;nbsp;&lt;SPAN class=""&gt;c611b43d-a574-4636-9116-ec45fe8090f8 from below.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Could you please let me know how I can do using&amp;nbsp;rex field=httpURL&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;httpURL&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN class=""&gt;/peerpayment/v1/payment/c611b43d-a574-4636-9116-ec45fe8090f8/performAction&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 16:59:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/680723#M232664</guid>
      <dc:creator>anil1219</dc:creator>
      <dc:date>2024-03-14T16:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data using rex ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/680733#M232668</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/260633"&gt;@anil1219&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if the structure of the URL is fixed, you could use&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "\/\w+\/\w+\/\w+\/(?&amp;lt;your_field&amp;gt;[^\/]+)"&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/K3yj0E/1" target="_blank"&gt;https://regex101.com/r/K3yj0E/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Cio.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 17:34:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/680733#M232668</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-03-14T17:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data using rex ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/680753#M232672</link>
      <description>&lt;P&gt;Or better, do not use regex because the URI has an inherent structure/convention that many APIs adhere to. (See, e.g., &lt;A href="https://community.splunk.com/t5/Getting-Data-In/How-do-I-modify-my-rex-command-to-remove-directory-location-from/m-p/679687#M113580" target="_blank"&gt;Re: How do I modify my rex command to remove direc...&lt;/A&gt;)&amp;nbsp; What you ask is the second to last segment of HTTP_PATH variable in CGI standard.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval actionID = mvindex(split(httpURL, "/"), -2)&lt;/LI-CODE&gt;&lt;P&gt;Semantic code is easier to maintain and in this case, potentially cheaper than regex.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 20:46:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/680753#M232672</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-03-14T20:46:15Z</dc:date>
    </item>
  </channel>
</rss>

