<?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: Remove string from field using REX or Replace in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Remove-string-from-field-using-REX-or-Replace/m-p/750262#M242280</link>
    <description>&lt;P&gt;I am having a similar issue however in my case the field always has a suffix of &lt;STRONG&gt;sophos_event_input&amp;nbsp;&lt;/STRONG&gt;after the username. Example&lt;/P&gt;&lt;P&gt;User&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Joe-Smith, Adams sophos_event_input&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Jane-Doe, Smith&amp;nbsp;sophos_event_input&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I would like to change the User field to&lt;/P&gt;&lt;P&gt;User&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Joe-Smith, Adams&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Jane-Doe, Smith&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Basically I want to get rid of the&amp;nbsp;sophos_event_input suffix.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;How will I go about this?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Jul 2025 15:12:35 GMT</pubDate>
    <dc:creator>Splunkie</dc:creator>
    <dc:date>2025-07-22T15:12:35Z</dc:date>
    <item>
      <title>Remove string from field using REX or Replace</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-string-from-field-using-REX-or-Replace/m-p/332907#M99013</link>
      <description>&lt;P&gt;I have a field, where all values are pre-fixed with "OPTIONS-IT\".&lt;BR /&gt;
I would like to remove this, but not sure on the best way to do it.&lt;/P&gt;

&lt;P&gt;example &lt;BR /&gt;
User&lt;BR /&gt;
OPTIONS-IT\smcdonald&lt;BR /&gt;
OPTIONS-IT\jbloggs&lt;/P&gt;

&lt;P&gt;I would like to change to &lt;BR /&gt;
User&lt;BR /&gt;
smcdonald&lt;BR /&gt;
jbloggs&lt;/P&gt;

&lt;P&gt;I have tried eval User= replace (User, "OPTIONS-IT\", "") but this doesn't work.&lt;/P&gt;

&lt;P&gt;The regular expressions I have used have not worked either.&lt;BR /&gt;
Any help appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2017 10:36:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-string-from-field-using-REX-or-Replace/m-p/332907#M99013</guid>
      <dc:creator>smcdonald20</dc:creator>
      <dc:date>2017-06-01T10:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: Remove string from field using REX or Replace</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-string-from-field-using-REX-or-Replace/m-p/332908#M99014</link>
      <description>&lt;P&gt;These methods support regular expression and "\" will be treated as escape character.&lt;BR /&gt;
Do it this way -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | rex field=User "OPTIONS.IT.(?&amp;lt;User&amp;gt;\S+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | eval User=replace (User, "OPTIONS\-IT.", "")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Jun 2017 10:44:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-string-from-field-using-REX-or-Replace/m-p/332908#M99014</guid>
      <dc:creator>dineshraj9</dc:creator>
      <dc:date>2017-06-01T10:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: Remove string from field using REX or Replace</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-string-from-field-using-REX-or-Replace/m-p/332909#M99015</link>
      <description>&lt;P&gt;Hi smcdonald20,&lt;BR /&gt;
Try the following command&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_search | rex field=your_field "OPTIONS-IT\\(?&amp;lt;username&amp;gt;[^ ]*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2017 11:21:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-string-from-field-using-REX-or-Replace/m-p/332909#M99015</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-06-01T11:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: Remove string from field using REX or Replace</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-string-from-field-using-REX-or-Replace/m-p/332910#M99016</link>
      <description>&lt;P&gt;Like this (needs more escape characters):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=User mode=sed "s/OPTIONS-IT\\\//g"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Jun 2017 13:24:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-string-from-field-using-REX-or-Replace/m-p/332910#M99016</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-06-01T13:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: Remove string from field using REX or Replace</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-string-from-field-using-REX-or-Replace/m-p/332911#M99017</link>
      <description>&lt;P&gt;This one works great! Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 23:06:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-string-from-field-using-REX-or-Replace/m-p/332911#M99017</guid>
      <dc:creator>ljalvrdz</dc:creator>
      <dc:date>2018-08-30T23:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: Remove string from field using REX or Replace</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-string-from-field-using-REX-or-Replace/m-p/565727#M197120</link>
      <description>&lt;P&gt;Worked like charm!!! Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 03 Sep 2021 00:29:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-string-from-field-using-REX-or-Replace/m-p/565727#M197120</guid>
      <dc:creator>daymauler</dc:creator>
      <dc:date>2021-09-03T00:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: Remove string from field using REX or Replace</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-string-from-field-using-REX-or-Replace/m-p/750262#M242280</link>
      <description>&lt;P&gt;I am having a similar issue however in my case the field always has a suffix of &lt;STRONG&gt;sophos_event_input&amp;nbsp;&lt;/STRONG&gt;after the username. Example&lt;/P&gt;&lt;P&gt;User&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Joe-Smith, Adams sophos_event_input&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Jane-Doe, Smith&amp;nbsp;sophos_event_input&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I would like to change the User field to&lt;/P&gt;&lt;P&gt;User&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Joe-Smith, Adams&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Jane-Doe, Smith&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Basically I want to get rid of the&amp;nbsp;sophos_event_input suffix.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;How will I go about this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jul 2025 15:12:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-string-from-field-using-REX-or-Replace/m-p/750262#M242280</guid>
      <dc:creator>Splunkie</dc:creator>
      <dc:date>2025-07-22T15:12:35Z</dc:date>
    </item>
  </channel>
</rss>

