<?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 portion of the different strings using Regex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-portion-of-the-different-strings-using-Regex/m-p/514990#M144561</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225066"&gt;@aditsss&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;the only way is to identify the possible words befor the field to extract (in your examples: connections, groups, services processors to insert in the regex, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "\/(connections|groups|services|processors)\/(?&amp;lt;Request_URL&amp;gt;\w*)"&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&amp;nbsp;&lt;A href="https://regex101.com/r/Tt0jLf/1" target="_blank"&gt;https://regex101.com/r/Tt0jLf/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Wed, 19 Aug 2020 15:49:46 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2020-08-19T15:49:46Z</dc:date>
    <item>
      <title>How to extract portion of the different strings using Regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-portion-of-the-different-strings-using-Regex/m-p/514960#M144553</link>
      <description>&lt;P&gt;Hi Eveyone,&lt;/P&gt;
&lt;P&gt;Can anyone help me out in this.&lt;/P&gt;
&lt;P&gt;I have a field name&amp;nbsp; &amp;nbsp; Request_URL which is different each time.&lt;/P&gt;
&lt;P&gt;Below are some examples for my Request_URL&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://xyz/api/connections/c1d30603ddf0" target="_blank" rel="noopener"&gt;https://xyz/api/connections/c1d30603ddf0&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;&lt;A href="https://lpdosputb50088.phx.aexp.com:9091/nifi-api/flow/process-groups/cccc33ba-46ae-13ed-a423-314e8fead333/controller-services" target="_blank" rel="noopener"&gt;https://yte/api/flow/groups/314e8fead333/controller-services&lt;/A&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://tyu/api/services/968d06b5666b" target="_blank" rel="noopener"&gt;https://tyu/api/services/968d06b5666b&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://hju/api/processors/b5f990b529f4/run-status" target="_blank" rel="noopener"&gt;https://hju/api/processors/b5f990b529f4/run-status&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;I want to extract "&lt;SPAN&gt;&lt;A href="https://xyz/api/connections/c1d30603ddf0" target="_blank" rel="noopener"&gt;c1d30603ddf0&lt;/A&gt;&lt;/SPAN&gt;" ,"b5f990b529f4" ,"&lt;A href="https://lpdosputb50088.phx.aexp.com:9091/nifi-api/flow/process-groups/cccc33ba-46ae-13ed-a423-314e8fead333/controller-services" target="_blank" rel="noopener"&gt;314e8fead333&lt;/A&gt;" portion from every Request_URL&amp;nbsp; as&amp;nbsp;Request_URL is different&amp;nbsp; for each one.&lt;/P&gt;
&lt;P&gt;Can someone guide me with the regular expression of it in splunk&lt;/P&gt;
&lt;P&gt;Thanks In advance&lt;/P&gt;
&lt;TABLE width="601px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="600px" height="46px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 18:36:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-portion-of-the-different-strings-using-Regex/m-p/514960#M144553</guid>
      <dc:creator>aditsss</dc:creator>
      <dc:date>2020-08-19T18:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract portion of the different strings using Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-portion-of-the-different-strings-using-Regex/m-p/514984#M144560</link>
      <description>&lt;P&gt;Hi Can anyone help me out with this.Its really urgent.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 15:38:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-portion-of-the-different-strings-using-Regex/m-p/514984#M144560</guid>
      <dc:creator>aditsss</dc:creator>
      <dc:date>2020-08-19T15:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract portion of the different strings using Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-portion-of-the-different-strings-using-Regex/m-p/514990#M144561</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225066"&gt;@aditsss&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;the only way is to identify the possible words befor the field to extract (in your examples: connections, groups, services processors to insert in the regex, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "\/(connections|groups|services|processors)\/(?&amp;lt;Request_URL&amp;gt;\w*)"&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&amp;nbsp;&lt;A href="https://regex101.com/r/Tt0jLf/1" target="_blank"&gt;https://regex101.com/r/Tt0jLf/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 15:49:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-portion-of-the-different-strings-using-Regex/m-p/514990#M144561</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-08-19T15:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract portion of the different strings using Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-portion-of-the-different-strings-using-Regex/m-p/514999#M144563</link>
      <description>&lt;P&gt;Hi gcusello&lt;/P&gt;&lt;P&gt;I cant hardcoded the words like this as there are mutiple URL's .These are some examples I have given.&lt;/P&gt;&lt;PRE&gt; rex "\/(connections|groups|services|processors)\/(?&amp;lt;Request_URL&amp;gt;\w*)"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Previously I only have this URL&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://xyz/api/groups/230df08c/registry" target="_blank" rel="nofollow noopener noreferrer"&gt;https://xyz/api/groups/230df08c/registry&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So I tried like this and it works .It was creating one new column process and fetching "&lt;A href="https://xyz/api/groups/230df08c/registry" target="_blank" rel="nofollow noopener noreferrer"&gt;230df08c" part in the process column.&lt;/A&gt;&amp;nbsp;that is (ID).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;| rex field=Request_URL "groups\/(?&amp;lt;process&amp;gt;[^\/]+)"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can you please guide me how can I do this now .&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 16:06:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-portion-of-the-different-strings-using-Regex/m-p/514999#M144563</guid>
      <dc:creator>aditsss</dc:creator>
      <dc:date>2020-08-19T16:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract portion of the different strings using Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-portion-of-the-different-strings-using-Regex/m-p/515027#M144568</link>
      <description>&lt;P&gt;It looks like you have a dynamic string to regex.&lt;/P&gt;&lt;P&gt;See this post -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Splunk-Search/Regex-for-dynamic-string/m-p/183009/highlight/true#M52695" target="_blank"&gt;https://community.splunk.com/t5/Splunk-Search/Regex-for-dynamic-string/m-p/183009/highlight/true#M52695&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 18:02:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-portion-of-the-different-strings-using-Regex/m-p/515027#M144568</guid>
      <dc:creator>SplunkRaz</dc:creator>
      <dc:date>2020-08-19T18:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract portion of the different strings using Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-portion-of-the-different-strings-using-Regex/m-p/515059#M144583</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;My URL's are&amp;nbsp; not dynamic.&lt;/P&gt;&lt;P&gt;But I dont want to put all the words that will come before id&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://xyz/api/connections/c1d30603ddf0" target="_blank" rel="noopener nofollow noopener noreferrer"&gt;https://xyz/api/connections/c1d30603ddf0&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;A href="https://lpdosputb50088.phx.aexp.com:9091/nifi-api/flow/process-groups/cccc33ba-46ae-13ed-a423-314e8fead333/controller-services" target="_blank" rel="noopener nofollow noopener noreferrer"&gt;https://yte/api/flow/groups/314e8fead333/controller-services&lt;/A&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://tyu/api/services/968d06b5666b" target="_blank" rel="noopener nofollow noopener noreferrer"&gt;https://tyu/api/services/968d06b5666b&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://hju/api/processors/b5f990b529f4/run-status" target="_blank" rel="noopener nofollow noopener noreferrer"&gt;https://hju/api/processors/b5f990b529f4/run-status&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried by putting this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;rex field=Request_URL "\/(controller|process-groups|connections|processors)\/(?&amp;lt;process&amp;gt;[^\/]+)"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Then only URl's related to these 4 words are coming . Other Url's like(shown below) are not coming.&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;https://yui/api/flow/config&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want all data should be displayed but URL's which contains id part"&lt;SPAN&gt;&lt;A href="https://hju/api/processors/b5f990b529f4/run-status" target="_blank" rel="noopener nofollow noopener noreferrer"&gt;b5f990b529f4" like this&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to extract id part "&lt;A href="https://hju/api/processors/b5f990b529f4/run-status" target="_blank" rel="noopener nofollow noopener noreferrer"&gt;b5f990b529f4&lt;/A&gt;" from the URL's which contain ID's. Should I need multiple regex or any number number regex we can use.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please guide me on that.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 20:05:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-portion-of-the-different-strings-using-Regex/m-p/515059#M144583</guid>
      <dc:creator>aditsss</dc:creator>
      <dc:date>2020-08-19T20:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract portion of the different strings using Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-portion-of-the-different-strings-using-Regex/m-p/515139#M144613</link>
      <description>&lt;P&gt;Can please someone guide me on that part. Its really required.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Aug 2020 08:11:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-portion-of-the-different-strings-using-Regex/m-p/515139#M144613</guid>
      <dc:creator>aditsss</dc:creator>
      <dc:date>2020-08-20T08:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract portion of the different strings using Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-portion-of-the-different-strings-using-Regex/m-p/515147#M144617</link>
      <description>&lt;P&gt;If you check the link i provided it reads -&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;The easiest solution is probably to rewrite the events with SEDCMD in props.conf on your indexer (or Heavy Forwarder);

[your sourcetype]
SEDCMD-blah = s/(\w+\.exe=\d{4,})/m_\1/g
As you can see, there are some assumptions here;
1) that all the stuff you want to rename ends in .exe
2) that they have at least a 4-digit value (i.e. greater than 1000)
3) that the binaries (i.e. field names) can contain only certain characters.

Adjust these things to suit your actual environment. Please note that this will actually change the events before the are written to disk, so if your'e not allowed to tamper with the data, this might not be the way to go.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I agree with that approach , your could try rewriting your events in the header&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Aug 2020 09:05:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-portion-of-the-different-strings-using-Regex/m-p/515147#M144617</guid>
      <dc:creator>SplunkRaz</dc:creator>
      <dc:date>2020-08-20T09:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract portion of the different strings using Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-portion-of-the-different-strings-using-Regex/m-p/515489#M144737</link>
      <description>&lt;P&gt;Hi gcusello,&lt;/P&gt;&lt;PRE&gt;| rex "\/(connections|groups|services|processors)\/(?&amp;lt;Request_URL&amp;gt;\w*)"&lt;/PRE&gt;&lt;P&gt;I can follow this but can you guide me I need to extract id from Request URL and need to put it one column (like id1 or something any name) which only&amp;nbsp; only contain id part of Request_URL .&lt;/P&gt;&lt;P&gt;Currently by this changes&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;| rex "\/(connections|groups|services|processors)\/(?&amp;lt;Request_URL&amp;gt;\w*)"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Its making the change directly in request URL . I need both REQUEST_URL ehich will contain complete URL and other is id which only contain id from Request_URL.&lt;/P&gt;&lt;P&gt;Can you provide me the regex for that?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2020 15:17:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-portion-of-the-different-strings-using-Regex/m-p/515489#M144737</guid>
      <dc:creator>aditsss</dc:creator>
      <dc:date>2020-08-21T15:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract portion of the different strings using Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-portion-of-the-different-strings-using-Regex/m-p/515491#M144738</link>
      <description>&lt;P&gt;Hi gcusello,&lt;/P&gt;&lt;PRE&gt;| rex "\/(connections|groups|services|processors)\/(?&amp;lt;Request_URL&amp;gt;\w*)"&lt;/PRE&gt;&lt;P&gt;I can follow this but can you guide me I need to extract id from Request URL and need to put it one column (like id1 or something any name) which only&amp;nbsp; only contain id part of Request_URL .&lt;/P&gt;&lt;P&gt;Currently by this changes&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;| rex "\/(connections|groups|services|processors)\/(?&amp;lt;Request_URL&amp;gt;\w*)"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Its making the change directly in request URL . I need both REQUEST_URL which will contain complete URL and other is id which only contain id from Request_URL.&lt;/P&gt;&lt;P&gt;Can you provide me the regex for that?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2020 15:19:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-portion-of-the-different-strings-using-Regex/m-p/515491#M144738</guid>
      <dc:creator>aditsss</dc:creator>
      <dc:date>2020-08-21T15:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract portion of the different strings using Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-portion-of-the-different-strings-using-Regex/m-p/515505#M144742</link>
      <description>&lt;P&gt;Can you please suggest me on this ASAP as its urgently required&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2020 16:10:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-portion-of-the-different-strings-using-Regex/m-p/515505#M144742</guid>
      <dc:creator>aditsss</dc:creator>
      <dc:date>2020-08-21T16:10:45Z</dc:date>
    </item>
  </channel>
</rss>

