<?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: Replace 2 different characters in the same field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-2-different-characters-in-the-same-field/m-p/628495#M218308</link>
    <description>&lt;P&gt;In your opinion what's the most efficient ?&lt;/P&gt;&lt;P&gt;" " or "\s" ?&lt;/P&gt;</description>
    <pubDate>Thu, 26 Jan 2023 15:06:10 GMT</pubDate>
    <dc:creator>fariapm1</dc:creator>
    <dc:date>2023-01-26T15:06:10Z</dc:date>
    <item>
      <title>How to replace 2 different characters in the same field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-2-different-characters-in-the-same-field/m-p/628467#M218294</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a csv that is imported to splunk and one of those fields has a space for the thousands and ends with&amp;nbsp; ",00",&amp;nbsp; I need it to be an integer only with numbers.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="fariapm1_1-1674740198350.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/23583i6798118166AD2C0F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="fariapm1_1-1674740198350.png" alt="fariapm1_1-1674740198350.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can solve this this with 2 lines:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| eval test=replace(field1,",00","")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| eval test=replace(test,"&amp;nbsp;","")&lt;/P&gt;
&lt;P&gt;But I want to create a new field with Calculated fields. How can I do that in one line of code?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 19:21:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-2-different-characters-in-the-same-field/m-p/628467#M218294</guid>
      <dc:creator>fariapm1</dc:creator>
      <dc:date>2023-01-26T19:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: Replace 2 different characters in the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-2-different-characters-in-the-same-field/m-p/628479#M218299</link>
      <description>&lt;LI-CODE lang="markup"&gt;| eval test=replace(replace(field1,",00","")," ","")&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 26 Jan 2023 14:09:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-2-different-characters-in-the-same-field/m-p/628479#M218299</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-01-26T14:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: Replace 2 different characters in the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-2-different-characters-in-the-same-field/m-p/628483#M218300</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;It worked.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've already tried that but if you notice the space has a red dot. When I tried its only the " "&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="fariapm1_0-1674742668161.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/23585i2F7D910FB658C598/image-size/medium?v=v2&amp;amp;px=400" role="button" title="fariapm1_0-1674742668161.png" alt="fariapm1_0-1674742668161.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tks for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 14:18:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-2-different-characters-in-the-same-field/m-p/628483#M218300</guid>
      <dc:creator>fariapm1</dc:creator>
      <dc:date>2023-01-26T14:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: Replace 2 different characters in the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-2-different-characters-in-the-same-field/m-p/628484#M218301</link>
      <description>&lt;P&gt;Given that the replace function supports regex expressions, you could try it this way:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval test=replace(replace(field1,",00",""),"\s","")&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 26 Jan 2023 14:23:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-2-different-characters-in-the-same-field/m-p/628484#M218301</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-01-26T14:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Replace 2 different characters in the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-2-different-characters-in-the-same-field/m-p/628495#M218308</link>
      <description>&lt;P&gt;In your opinion what's the most efficient ?&lt;/P&gt;&lt;P&gt;" " or "\s" ?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 15:06:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-2-different-characters-in-the-same-field/m-p/628495#M218308</guid>
      <dc:creator>fariapm1</dc:creator>
      <dc:date>2023-01-26T15:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: Replace 2 different characters in the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-2-different-characters-in-the-same-field/m-p/628498#M218310</link>
      <description>&lt;P&gt;It depends on your events - if spaces are the only type of white space used, then " " would be slightly more efficient, although improvement that might not be detectable, so if there is a possibility that other white space characters might be used, then "\s" might be safer.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 15:23:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-2-different-characters-in-the-same-field/m-p/628498#M218310</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-01-26T15:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: Replace 2 different characters in the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-2-different-characters-in-the-same-field/m-p/628500#M218313</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;In this case it was a new type of space that appeared in my CSV file and it's not the 1st time that this happens.&lt;/P&gt;&lt;P&gt;Thank you for your support !!!&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 15:31:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-2-different-characters-in-the-same-field/m-p/628500#M218313</guid>
      <dc:creator>fariapm1</dc:creator>
      <dc:date>2023-01-26T15:31:50Z</dc:date>
    </item>
  </channel>
</rss>

