<?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 in SPL2 not working like SPL in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Replace-in-SPL2-not-working-like-SPL/m-p/741629#M240653</link>
    <description>&lt;P&gt;Oh for some reason the image of the SPL2 result didnt post so here it is:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-03-13 143138.png" style="width: 665px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/38154iF7F2BF7FEE989234/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-03-13 143138.png" alt="Screenshot 2025-03-13 143138.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Mar 2025 01:42:37 GMT</pubDate>
    <dc:creator>KeithH</dc:creator>
    <dc:date>2025-03-13T01:42:37Z</dc:date>
    <item>
      <title>Replace in SPL2 not working like SPL</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-in-SPL2-not-working-like-SPL/m-p/741627#M240652</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am having trouble getting replace to work correctly in Ingest Processor and have this example.&lt;/P&gt;&lt;P&gt;In SPL I can run this search:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval test = "AAABBBCCC" 
| eval text = "\\\"test\\\":\\\"" 
| eval output = replace(test, "BBB", text)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and I will get this output&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image (4).png" style="width: 244px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/38150i2997CD7A75DE0851/image-size/large?v=v2&amp;amp;px=999" role="button" title="image (4).png" alt="image (4).png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But if I run this in a Ingest Processor pipeline&lt;/P&gt;&lt;P&gt;| eval test = "AAABBBCCC"&lt;BR /&gt;| eval text = "\\\"test\\\":\\\""&lt;BR /&gt;| eval output = replace(test, "BBB", text)&lt;/P&gt;&lt;P&gt;The result is:&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note the slashes before the doublequotes have gone.&lt;/P&gt;&lt;P&gt;Why have they gone?&lt;/P&gt;&lt;P&gt;How do I ensure they are retained by Ingest Processor.&lt;/P&gt;&lt;P&gt;This is a simplified example of what I am trying to do but this is the core of the problem I am having.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 01:40:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-in-SPL2-not-working-like-SPL/m-p/741627#M240652</guid>
      <dc:creator>KeithH</dc:creator>
      <dc:date>2025-03-13T01:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: Replace in SPL2 not working like SPL</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-in-SPL2-not-working-like-SPL/m-p/741629#M240653</link>
      <description>&lt;P&gt;Oh for some reason the image of the SPL2 result didnt post so here it is:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-03-13 143138.png" style="width: 665px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/38154iF7F2BF7FEE989234/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-03-13 143138.png" alt="Screenshot 2025-03-13 143138.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 01:42:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-in-SPL2-not-working-like-SPL/m-p/741629#M240653</guid>
      <dc:creator>KeithH</dc:creator>
      <dc:date>2025-03-13T01:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: Replace in SPL2 not working like SPL</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-in-SPL2-not-working-like-SPL/m-p/741633#M240655</link>
      <description>&lt;P&gt;Splunk uses PCRE and also the search parser will handle unescaping, whereas Ingest Processor uses RE2 - although that appears to be changing. So you probably need to use 2 \\ characters, not 3 as the Splunk parser will take away one.&lt;/P&gt;&lt;P&gt;But validate&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 03:47:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-in-SPL2-not-working-like-SPL/m-p/741633#M240655</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2025-03-13T03:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: Replace in SPL2 not working like SPL</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-in-SPL2-not-working-like-SPL/m-p/741635#M240656</link>
      <description>&lt;P&gt;Hi Bowesmana,&lt;/P&gt;&lt;P&gt;I tried that too but the editor wont even let me save it that way:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KeithH_0-1741839937577.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/38155i02818C1F7BF61583/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KeithH_0-1741839937577.png" alt="KeithH_0-1741839937577.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Also note that while this simple example illustrates the problem the real data is extracted by&amp;nbsp; previous rex command so my ability to manipulate it is limited.&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 04:26:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-in-SPL2-not-working-like-SPL/m-p/741635#M240656</guid>
      <dc:creator>KeithH</dc:creator>
      <dc:date>2025-03-13T04:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: Replace in SPL2 not working like SPL</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-in-SPL2-not-working-like-SPL/m-p/741735#M240679</link>
      <description>&lt;P&gt;Mmm, OK, I was going to suggest the SPL2 channel in the Splunk Slack group, but I see you already found that.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 22:38:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-in-SPL2-not-working-like-SPL/m-p/741735#M240679</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2025-03-13T22:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: Replace in SPL2 not working like SPL</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-in-SPL2-not-working-like-SPL/m-p/741929#M240728</link>
      <description>&lt;P&gt;UPDATE:&amp;nbsp; I pursued this via another angle and have had agreement from Splunk that this seems to be a bug and that they will put some work into it though I dont have any reference number or ETA as yet.&lt;/P&gt;&lt;P&gt;In the meantime I am use the rex command with mode=sed to achieve something acceptable but not as good as I would have liked.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Mar 2025 00:30:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-in-SPL2-not-working-like-SPL/m-p/741929#M240728</guid>
      <dc:creator>KeithH</dc:creator>
      <dc:date>2025-03-17T00:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: Replace in SPL2 not working like SPL</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-in-SPL2-not-working-like-SPL/m-p/742277#M240811</link>
      <description>&lt;P&gt;Further Update:&amp;nbsp; Splunk fixed the bug and expect it to be released to Splunk Cloud in the next couple of weeks.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2025 00:59:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-in-SPL2-not-working-like-SPL/m-p/742277#M240811</guid>
      <dc:creator>KeithH</dc:creator>
      <dc:date>2025-03-20T00:59:50Z</dc:date>
    </item>
  </channel>
</rss>

