<?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 field using mode=sed for name extraction? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-using-mode-sed-for-name-extraction/m-p/335966#M99761</link>
    <description>&lt;P&gt;There are many API i need to extract all the API &lt;/P&gt;

&lt;P&gt;/v1/caremanagement/utilizationmanagementinquiry/casesummary?id=260M58490&lt;BR /&gt;&lt;BR /&gt;
/v1/caremanagement/utilizationmanagementinquiry/casesummary?id=372A69838&lt;BR /&gt;
/v0/providers/codes/list/AREA_OF_EXPERTISE&lt;BR /&gt;&lt;BR /&gt;
/v0/providers/codes/list/LANGUAGES&lt;BR /&gt;&lt;BR /&gt;
/v0/providers/codes/list/PATIENT_PREFERENCES&lt;BR /&gt;&lt;BR /&gt;
/v0/providers/codes/list/PROVIDER_TYPES &lt;BR /&gt;
/v0/providers/details/byid/#####?sourcesystemid=0&lt;BR /&gt;&lt;BR /&gt;
/v0/providers/professionals/search&lt;BR /&gt;&lt;BR /&gt;
/v0/providers/specialities/list/C?levelofcareind=false&lt;BR /&gt;&lt;BR /&gt;
/v0/providers/specialities/list/C?levelofcareind=true&lt;/P&gt;

&lt;P&gt;Expected result :&lt;BR /&gt;
/v1/caremanagement/utilizationmanagementinquiry/casesummary&lt;BR /&gt;
/v0/providers/codes/list&lt;BR /&gt;
/v0/providers/specialities/list&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 17:12:28 GMT</pubDate>
    <dc:creator>karthi2809</dc:creator>
    <dc:date>2020-09-29T17:12:28Z</dc:date>
    <item>
      <title>How to extract field using mode=sed for name extraction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-using-mode-sed-for-name-extraction/m-p/335962#M99757</link>
      <description>&lt;P&gt;How to extract field using mode=sed for name extraction?&lt;/P&gt;

&lt;P&gt;index=test  Sender=PEGAS | rex field= URI"^(?.+?)(\?|\z)" | rex field=URI mode=sed "s/[0-9A-F]{32}/#####/g" &lt;BR /&gt;
| rex field=URI mode=sed "s/[0-9]{7}[\w]{2}[\d]{4}/#####/g" &lt;BR /&gt;
| stats count by URI&lt;/P&gt;

&lt;P&gt;My output :&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3988i1533754788AD3E52/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Expected result :&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3989i8C3870A290604035/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 13:02:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-using-mode-sed-for-name-extraction/m-p/335962#M99757</guid>
      <dc:creator>karthi2809</dc:creator>
      <dc:date>2017-12-11T13:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract field using mode=sed for name extraction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-using-mode-sed-for-name-extraction/m-p/335963#M99758</link>
      <description>&lt;P&gt;Hi @karthi2809,&lt;/P&gt;

&lt;P&gt;If I am understanding your question correctly you want to extract everything before last &lt;CODE&gt;/&lt;/CODE&gt; then you can use regex &lt;CODE&gt;| rex "(?&amp;lt;URI&amp;gt;.*)\/"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Sample query based on sample data which you have provided below query will extract everything before last &lt;CODE&gt;/&lt;/CODE&gt; and after that I am filtering &lt;CODE&gt;/v0/providers/code/list/&lt;/CODE&gt; in &lt;CODE&gt;where&lt;/CODE&gt; command. First 2 lines in below query used to generate sample data.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="/v0/providers/code/list/LANGUAGE"
| rex "(?&amp;lt;Extracted_URI&amp;gt;.*)\/"
| where Extracted_URI="/v0/providers/code/list"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So your query will be&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt; your search&amp;gt;  | rex field=URI "(?&amp;lt;Extracted_URI&amp;gt;.*)\/" | where Extratced_URI="/v0/providers/code/list"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Dec 2017 13:13:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-using-mode-sed-for-name-extraction/m-p/335963#M99758</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2017-12-11T13:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract field using mode=sed for name extraction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-using-mode-sed-for-name-extraction/m-p/335964#M99759</link>
      <description>&lt;P&gt;@karthi2809, can you use the &lt;CODE&gt;code button (101010)&lt;/CODE&gt; on Splunk Answers to post your SPL so that special characters do not escape? Also values in your current output feel similar to expected output. What is the difference you want to see? Can you give example value of field URI and what you need to extract/convert in the same?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 13:16:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-using-mode-sed-for-name-extraction/m-p/335964#M99759</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-12-11T13:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract field using mode=sed for name extraction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-using-mode-sed-for-name-extraction/m-p/335965#M99760</link>
      <description>&lt;P&gt;My output:&lt;BR /&gt;
/v0/providers/codes/list/LANGUAGES&lt;BR /&gt;&lt;BR /&gt;
/v0/providers/codes/list/PATIENT_PREFERENCES&lt;BR /&gt;&lt;BR /&gt;
/v0/providers/codes/list/PROVIDER_TYPES &lt;BR /&gt;
/v0/providers/details/byid/#####?sourcesystemid=0&lt;BR /&gt;&lt;BR /&gt;
/v0/providers/professionals/search&lt;BR /&gt;&lt;BR /&gt;
/v0/providers/specialities/list/C?levelofcareind=false&lt;BR /&gt;&lt;BR /&gt;
/v0/providers/specialities/list/C?levelofcareind=true&lt;BR /&gt;&lt;BR /&gt;
/v0/providers/specialities/list/L?levelofcareind=false&lt;BR /&gt;
/v1/caremanagement/utilizationmanagementinquiry/casesummary?id=260M58&lt;BR /&gt;&lt;BR /&gt;
/v1/caremanagement/utilizationmanagementinquiry/casesummary?id=372A69&lt;/P&gt;

&lt;P&gt;Expected result is &lt;BR /&gt;
/v0/providers/codes/list&lt;BR /&gt;
/v0/providers/specialities/list&lt;BR /&gt;
/v1/caremanagement/utilizationmanagementinquiry/casesummary&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:12:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-using-mode-sed-for-name-extraction/m-p/335965#M99760</guid>
      <dc:creator>karthi2809</dc:creator>
      <dc:date>2020-09-29T17:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract field using mode=sed for name extraction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-using-mode-sed-for-name-extraction/m-p/335966#M99761</link>
      <description>&lt;P&gt;There are many API i need to extract all the API &lt;/P&gt;

&lt;P&gt;/v1/caremanagement/utilizationmanagementinquiry/casesummary?id=260M58490&lt;BR /&gt;&lt;BR /&gt;
/v1/caremanagement/utilizationmanagementinquiry/casesummary?id=372A69838&lt;BR /&gt;
/v0/providers/codes/list/AREA_OF_EXPERTISE&lt;BR /&gt;&lt;BR /&gt;
/v0/providers/codes/list/LANGUAGES&lt;BR /&gt;&lt;BR /&gt;
/v0/providers/codes/list/PATIENT_PREFERENCES&lt;BR /&gt;&lt;BR /&gt;
/v0/providers/codes/list/PROVIDER_TYPES &lt;BR /&gt;
/v0/providers/details/byid/#####?sourcesystemid=0&lt;BR /&gt;&lt;BR /&gt;
/v0/providers/professionals/search&lt;BR /&gt;&lt;BR /&gt;
/v0/providers/specialities/list/C?levelofcareind=false&lt;BR /&gt;&lt;BR /&gt;
/v0/providers/specialities/list/C?levelofcareind=true&lt;/P&gt;

&lt;P&gt;Expected result :&lt;BR /&gt;
/v1/caremanagement/utilizationmanagementinquiry/casesummary&lt;BR /&gt;
/v0/providers/codes/list&lt;BR /&gt;
/v0/providers/specialities/list&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:12:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-using-mode-sed-for-name-extraction/m-p/335966#M99761</guid>
      <dc:creator>karthi2809</dc:creator>
      <dc:date>2020-09-29T17:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract field using mode=sed for name extraction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-using-mode-sed-for-name-extraction/m-p/335967#M99762</link>
      <description>&lt;P&gt;Expected Results and Output which you have provided have not consistent unique pattern because in &lt;CODE&gt;/v1/caremanagement/utilizationmanagementinquiry/casesummary?id=260M58490&lt;/CODE&gt; this API call you want to extract everything before &lt;CODE&gt;?&lt;/CODE&gt; however &lt;CODE&gt;/v0/providers/specialities/list/C?levelofcareind=false&lt;/CODE&gt; in this API call you want to extract everything before &lt;CODE&gt;/&lt;/CODE&gt; so can we have unique pattern please ? If not then we can't assume that on which API call you want to extract till which delimiter.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 14:29:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-using-mode-sed-for-name-extraction/m-p/335967#M99762</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2017-12-11T14:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract field using mode=sed for name extraction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-using-mode-sed-for-name-extraction/m-p/335968#M99763</link>
      <description>&lt;P&gt;You don't want these lines?? &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/v0/providers/details/byid/#####?sourcesystemid=0 
/v0/providers/professionals/search 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Dec 2017 17:06:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-using-mode-sed-for-name-extraction/m-p/335968#M99763</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-12-11T17:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract field using mode=sed for name extraction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-using-mode-sed-for-name-extraction/m-p/335969#M99764</link>
      <description>&lt;P&gt;Try This , i replaced the '?' in the sting by '/' - Now the string that you want would be everything before the last '/'&lt;/P&gt;

&lt;P&gt;| makeresults &lt;BR /&gt;
| eval _raw="/v1/caremanagement/utilizationmanagementinquiry/casesummary?id=260M58"&lt;BR /&gt;
| rex mode=sed field=_raw "s/\?/\//g"&lt;BR /&gt;
| rex field=_raw "(?&amp;lt;_raw&amp;gt;.*)\/"&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:29:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-field-using-mode-sed-for-name-extraction/m-p/335969#M99764</guid>
      <dc:creator>saurabhkharkar</dc:creator>
      <dc:date>2020-09-29T22:29:28Z</dc:date>
    </item>
  </channel>
</rss>

