<?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: Extract field after text in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extract-field-after-text/m-p/568294#M198032</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/238741"&gt;@ashvini_mishra&lt;/a&gt;&amp;nbsp;Try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=_raw "ids\/(?P&amp;lt;url&amp;gt;.*?)\?"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if this is some fieldname then just replace &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;_raw&lt;/FONT&gt; &lt;/STRONG&gt;by your &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;fieldname&lt;/STRONG&gt;&lt;/FONT&gt;, or use the below rex:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=log "ids\/(?P&amp;lt;url&amp;gt;.*?)\?"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, If this reply helps you, an upvote would be appreciated.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Sep 2021 17:27:33 GMT</pubDate>
    <dc:creator>ashvinpandey</dc:creator>
    <dc:date>2021-09-23T17:27:33Z</dc:date>
    <item>
      <title>Extract field after text</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-field-after-text/m-p/568287#M198030</link>
      <description>&lt;P&gt;Here is log example -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://host/manager/resource_identifier/ids/" target="_blank" rel="nofollow noopener noreferrer"&gt;http://host/manager/resource_identifier/ids/&lt;/A&gt;&lt;SPAN&gt;getOrCreate/bulk?dscid=LuSxrA-1c42bb5b-f862-4861-892f-69320e1a59e7:200 Created:78&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I need to extract string after ids/ untill first ? or :&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So output would be -&amp;nbsp;getOrCreate/bulk&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am trying this -&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="100%"&gt;&lt;SPAN&gt;rex field=log ":(?&amp;lt;url&amp;gt;ids\/[^?: ]*)"&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I missing?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Sep 2021 17:05:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-field-after-text/m-p/568287#M198030</guid>
      <dc:creator>ashvini_mishra</dc:creator>
      <dc:date>2021-09-23T17:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: Extract field after text</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-field-after-text/m-p/568292#M198031</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Please, try the following:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=log "ids\/(?&amp;lt;url&amp;gt;[^\?|\:]+)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If your "log" field is not presenting the log example that you used, you can try substitute &lt;STRONG&gt;field=log&lt;/STRONG&gt; to &lt;STRONG&gt;field=_raw&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Sep 2021 17:19:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-field-after-text/m-p/568292#M198031</guid>
      <dc:creator>danielcj</dc:creator>
      <dc:date>2021-09-23T17:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Extract field after text</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-field-after-text/m-p/568294#M198032</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/238741"&gt;@ashvini_mishra&lt;/a&gt;&amp;nbsp;Try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=_raw "ids\/(?P&amp;lt;url&amp;gt;.*?)\?"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if this is some fieldname then just replace &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;_raw&lt;/FONT&gt; &lt;/STRONG&gt;by your &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;fieldname&lt;/STRONG&gt;&lt;/FONT&gt;, or use the below rex:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=log "ids\/(?P&amp;lt;url&amp;gt;.*?)\?"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, If this reply helps you, an upvote would be appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Sep 2021 17:27:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-field-after-text/m-p/568294#M198032</guid>
      <dc:creator>ashvinpandey</dc:creator>
      <dc:date>2021-09-23T17:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: Extract field after text</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-field-after-text/m-p/568297#M198034</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213178"&gt;@danielcj&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/199978"&gt;@ashvinpandey&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank for your responses, this works -&amp;nbsp;&lt;/P&gt;&lt;P&gt;I saw some of my logs don't have "ids/" in them, in that case url turns out to be blank. Here how&amp;nbsp; can I perform an OR operation to calculate url as -&amp;nbsp; &amp;nbsp;rex field=log "com\/(?&amp;lt;url&amp;gt;[^\?|\:\/ ]+)"&lt;/P&gt;&lt;P&gt;That is -&amp;nbsp;&lt;/P&gt;&lt;P&gt;if&amp;nbsp; -&amp;nbsp; "ids\/(?P&amp;lt;url&amp;gt;[^?:\s]+)" return blank then extract url as -&amp;nbsp; "com\/(?&amp;lt;url&amp;gt;[^\?|\:\/ ]+)"&lt;/P&gt;</description>
      <pubDate>Thu, 23 Sep 2021 18:29:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-field-after-text/m-p/568297#M198034</guid>
      <dc:creator>ashvini_mishra</dc:creator>
      <dc:date>2021-09-23T18:29:06Z</dc:date>
    </item>
  </channel>
</rss>

