<?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 remove a portion of string in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-remove-a-portion-of-string/m-p/564277#M196563</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/237676"&gt;@leecholim&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand: do you want to remove the part of the event at index time (before indexing) or at search time (when data is displayed)?&lt;/P&gt;&lt;P&gt;In the second case, you have to use a simple regex like this to extract only the part of the field that you want.&lt;/P&gt;&lt;P&gt;E.g.: if the field containing the data to cut is "my_field", try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=my_field "^(?&amp;lt;my_new_field&amp;gt;[^\/]*)"&lt;/LI-CODE&gt;&lt;P&gt;If instead you want to delete the part of the event before indexing, you have to use the SEDCMD command (for more infos see at&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.2.1/Data/Anonymizedata" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.2.1/Data/Anonymizedata&lt;/A&gt;) but in this case you cannot use the other information contained in the deleted part of the event.&lt;/P&gt;&lt;P&gt;I cannot give you the regex to do this because I need some sample of the full events.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Mon, 23 Aug 2021 08:14:05 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2021-08-23T08:14:05Z</dc:date>
    <item>
      <title>how to remove a portion of string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-remove-a-portion-of-string/m-p/564273#M196561</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;my data as below:&lt;/P&gt;&lt;P&gt;11111_aaaa/ppppaaaa&lt;/P&gt;&lt;P&gt;1110_bb/kjm&lt;/P&gt;&lt;P&gt;I want to remove anything after /, like this&lt;/P&gt;&lt;P&gt;11111_aaaa&lt;/P&gt;&lt;P&gt;1110_bb&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 08:02:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-remove-a-portion-of-string/m-p/564273#M196561</guid>
      <dc:creator>leecholim</dc:creator>
      <dc:date>2021-08-23T08:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove a portion of string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-remove-a-portion-of-string/m-p/564277#M196563</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/237676"&gt;@leecholim&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand: do you want to remove the part of the event at index time (before indexing) or at search time (when data is displayed)?&lt;/P&gt;&lt;P&gt;In the second case, you have to use a simple regex like this to extract only the part of the field that you want.&lt;/P&gt;&lt;P&gt;E.g.: if the field containing the data to cut is "my_field", try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=my_field "^(?&amp;lt;my_new_field&amp;gt;[^\/]*)"&lt;/LI-CODE&gt;&lt;P&gt;If instead you want to delete the part of the event before indexing, you have to use the SEDCMD command (for more infos see at&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.2.1/Data/Anonymizedata" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.2.1/Data/Anonymizedata&lt;/A&gt;) but in this case you cannot use the other information contained in the deleted part of the event.&lt;/P&gt;&lt;P&gt;I cannot give you the regex to do this because I need some sample of the full events.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 08:14:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-remove-a-portion-of-string/m-p/564277#M196563</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-08-23T08:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove a portion of string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-remove-a-portion-of-string/m-p/564280#M196564</link>
      <description>&lt;P&gt;Use the rex command and have regex cut it down.&lt;/P&gt;&lt;P&gt;| makeresults&lt;/P&gt;&lt;P&gt;| eval foo=“&lt;SPAN&gt;11111_aaaa/ppppaaaa”&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| rex field=foo “^(?P&amp;lt;foo&amp;gt;[^\/]*)”&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This uses regex on the foo field to take everything from the beginning of that field until the “/“ and assign back to the field foo.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 08:16:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-remove-a-portion-of-string/m-p/564280#M196564</guid>
      <dc:creator>jwalthour</dc:creator>
      <dc:date>2021-08-23T08:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove a portion of string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-remove-a-portion-of-string/m-p/564284#M196565</link>
      <description>&lt;P&gt;length before / is different for data...&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 08:21:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-remove-a-portion-of-string/m-p/564284#M196565</guid>
      <dc:creator>leecholim</dc:creator>
      <dc:date>2021-08-23T08:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove a portion of string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-remove-a-portion-of-string/m-p/564285#M196566</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/237676"&gt;@leecholim&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;lenght isn't relevant!&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 08:22:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-remove-a-portion-of-string/m-p/564285#M196566</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-08-23T08:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove a portion of string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-remove-a-portion-of-string/m-p/564287#M196567</link>
      <description>&lt;P&gt;thanks, will try.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 08:27:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-remove-a-portion-of-string/m-p/564287#M196567</guid>
      <dc:creator>leecholim</dc:creator>
      <dc:date>2021-08-23T08:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove a portion of string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-remove-a-portion-of-string/m-p/564288#M196568</link>
      <description>&lt;P&gt;leecholim -&lt;/P&gt;&lt;P&gt;Please mark an answer as your solution once you’ve tried.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 08:30:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-remove-a-portion-of-string/m-p/564288#M196568</guid>
      <dc:creator>jwalthour</dc:creator>
      <dc:date>2021-08-23T08:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove a portion of string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-remove-a-portion-of-string/m-p/564289#M196569</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/237676"&gt;@leecholim&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;good for you, see next time.&lt;/P&gt;&lt;P&gt;Remember to accept the answer for the other people of Community and Karma Points are appreciated by all the Contributors.&lt;/P&gt;&lt;P&gt;Ciao and happy splunking.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 08:31:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-remove-a-portion-of-string/m-p/564289#M196569</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-08-23T08:31:23Z</dc:date>
    </item>
  </channel>
</rss>

