<?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 replace a character with blank/space value? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-character-with-blank-space-value/m-p/376956#M167496</link>
    <description>&lt;P&gt;hi @zacksoft&lt;/P&gt;

&lt;P&gt;try this &lt;CODE&gt;|makeresults |eval hari="Intake3++B2N+Lan+07492018.xlsm" |table hari | rex field=hari mode=sed "s/\+/ /g"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;if it is helped accept as answer&lt;/P&gt;</description>
    <pubDate>Tue, 18 Sep 2018 11:32:38 GMT</pubDate>
    <dc:creator>harishalipaka</dc:creator>
    <dc:date>2018-09-18T11:32:38Z</dc:date>
    <item>
      <title>How to replace a character with blank/space value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-character-with-blank-space-value/m-p/376955#M167495</link>
      <description>&lt;P&gt;My field name is 'fileName' and the values it contains are like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;PVOLFEPCL-00515+Berger+Profile+Settings.docx
Intake3++B2N+Lan+07492018.xlsm
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want it to be like this,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;PVOLFEPCL-00515 Berger Profile Settings.docx
Intake3 B2N Lan 07492018.xlsm
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The ''&lt;STRONG&gt;+&lt;/STRONG&gt;" has to be replaced by Space .&lt;/P&gt;

&lt;P&gt;I tried the following , but it doesn't work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="*evilcorp*.fantasy.com" "affirative"
| rex field=_raw "^[^&amp;amp;\n]*&amp;amp;\w+=(?P&amp;lt;fileName&amp;gt;[^ ]+)(?:[^ \n]* ){3}(?P&amp;lt;ttr&amp;gt;.+)" 
| table userid fileName ttr 
 | replace "+" WITH "" IN fileName
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Sep 2018 10:19:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-character-with-blank-space-value/m-p/376955#M167495</guid>
      <dc:creator>zacksoft</dc:creator>
      <dc:date>2018-09-18T10:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace a character with blank/space value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-character-with-blank-space-value/m-p/376956#M167496</link>
      <description>&lt;P&gt;hi @zacksoft&lt;/P&gt;

&lt;P&gt;try this &lt;CODE&gt;|makeresults |eval hari="Intake3++B2N+Lan+07492018.xlsm" |table hari | rex field=hari mode=sed "s/\+/ /g"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;if it is helped accept as answer&lt;/P&gt;</description>
      <pubDate>Tue, 18 Sep 2018 11:32:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-character-with-blank-space-value/m-p/376956#M167496</guid>
      <dc:creator>harishalipaka</dc:creator>
      <dc:date>2018-09-18T11:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace a character with blank/space value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-character-with-blank-space-value/m-p/376957#M167497</link>
      <description>&lt;P&gt;Hi @zacksoft,&lt;/P&gt;

&lt;P&gt;Please try below query.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;yourBaseQuery&amp;gt;
| rex mode=sed field=&amp;lt;fieldname&amp;gt; "s/([^\+])(?:\++)/\1 /g"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here is run anywhere search which is generating correct ouput&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval testfield="PVOLFEPCL-00515+Berger+Profile+Settings.docx"
| append [ makeresults | eval testfield="Intake3++B2N+Lan+07492018.xlsm" ]
| rex mode=sed field=testfield "s/([^\+])(?:\++)/\1 /g"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Sep 2018 13:28:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-character-with-blank-space-value/m-p/376957#M167497</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2018-09-18T13:28:40Z</dc:date>
    </item>
  </channel>
</rss>

