<?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 function itself is not working when i did a splunk search query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/replace-function-itself-is-not-working-when-i-did-a-splunk/m-p/460392#M191312</link>
    <description>&lt;P&gt;Based on your comment, consider using &lt;CODE&gt;rex&lt;/CODE&gt; instead of &lt;CODE&gt;replace&lt;/CODE&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=message mode=sed "s/Data\s*=\s*//"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 03 Feb 2020 17:44:21 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2020-02-03T17:44:21Z</dc:date>
    <item>
      <title>replace function itself is not working when i did a splunk search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-function-itself-is-not-working-when-i-did-a-splunk/m-p/460389#M191309</link>
      <description>&lt;P&gt;I have a use case where i need to pass the previously performed search query to replace the part of message with empty string. environment="dev" domain="test" logger_name="com.test.practice.demo.sse.impl.EventEncrypter" message="Data = "| eval message=replace(message," Data = ","") The above message in turn obtained must be used to do another operation. But the replace function itself is not working when i did a splunk search query. I am able to see the log with "Data =" being not removed and came as it is. I need to do this asap. can u pls provide a solution ?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 10:44:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-function-itself-is-not-working-when-i-did-a-splunk/m-p/460389#M191309</guid>
      <dc:creator>d942725</dc:creator>
      <dc:date>2020-02-03T10:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: replace function itself is not working when i did a splunk search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-function-itself-is-not-working-when-i-did-a-splunk/m-p/460390#M191310</link>
      <description>&lt;P&gt;In &lt;CODE&gt;environment="dev" domain="test" logger_name="com.test.practice.demo.sse.impl.EventEncrypter" message="Data = "| eval message=replace(message," Data = ","")&lt;/CODE&gt; the &lt;CODE&gt;replace&lt;/CODE&gt; command has a space before "Data" so it does not match the sample event.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 14:09:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-function-itself-is-not-working-when-i-did-a-splunk/m-p/460390#M191310</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-02-03T14:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: replace function itself is not working when i did a splunk search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-function-itself-is-not-working-when-i-did-a-splunk/m-p/460391#M191311</link>
      <description>&lt;P&gt;I've a message as displayed below from the log.&lt;/P&gt;

&lt;P&gt;message: Data = {"data":{"time":"2020-02-03T12:43:49+00:00",". Tried either of the ways without space before Data and without space. But nothing has sorted out the issue. I need to remove the " Data = " in the above message and must be able to get the actual json. Please help with the possible ways.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 17:24:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-function-itself-is-not-working-when-i-did-a-splunk/m-p/460391#M191311</guid>
      <dc:creator>d942725</dc:creator>
      <dc:date>2020-02-03T17:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: replace function itself is not working when i did a splunk search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-function-itself-is-not-working-when-i-did-a-splunk/m-p/460392#M191312</link>
      <description>&lt;P&gt;Based on your comment, consider using &lt;CODE&gt;rex&lt;/CODE&gt; instead of &lt;CODE&gt;replace&lt;/CODE&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=message mode=sed "s/Data\s*=\s*//"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Feb 2020 17:44:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-function-itself-is-not-working-when-i-did-a-splunk/m-p/460392#M191312</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-02-03T17:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: replace function itself is not working when i did a splunk search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-function-itself-is-not-working-when-i-did-a-splunk/m-p/460393#M191313</link>
      <description>&lt;P&gt;environment="sit" domain="test" logger_name="com.test.practice.demo.sse.impl.EventEncrypter" message="&lt;EM&gt;Data =&lt;/EM&gt;"| rex field=message mode=sed "s/Data\s*=\s*//" &lt;/P&gt;

&lt;P&gt;used the above query in Splunk UI&lt;/P&gt;

&lt;P&gt;Still able to see the output as below:&lt;/P&gt;

&lt;P&gt;message: Data = {"data":{"time":"2020-02-03T12:43:49+00:00",&lt;/P&gt;

&lt;P&gt;" Data = " was still not removed from the actual message:&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:01:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-function-itself-is-not-working-when-i-did-a-splunk/m-p/460393#M191313</guid>
      <dc:creator>d942725</dc:creator>
      <dc:date>2020-09-30T04:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: replace function itself is not working when i did a splunk search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-function-itself-is-not-working-when-i-did-a-splunk/m-p/460394#M191314</link>
      <description>&lt;P&gt;Hi @d942725 - Try using _raw in field  name .&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=_raw mode=sed "s/Data\s*=\s*//"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Feb 2020 19:15:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-function-itself-is-not-working-when-i-did-a-splunk/m-p/460394#M191314</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2020-02-03T19:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: replace function itself is not working when i did a splunk search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-function-itself-is-not-working-when-i-did-a-splunk/m-p/460395#M191315</link>
      <description>&lt;P&gt;There must be something about your data that is not included in this question because the following run-anywhere example works.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults annotate=true | eval message="Data = {\"data\":{\"time\":\"2020-02-03T12:43:49+00:00\"" | rex field=message mode=sed "s/Data\s*=\s*//" | table message
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Feb 2020 19:29:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-function-itself-is-not-working-when-i-did-a-splunk/m-p/460395#M191315</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-02-03T19:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: replace function itself is not working when i did a splunk search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-function-itself-is-not-working-when-i-did-a-splunk/m-p/460396#M191316</link>
      <description>&lt;P&gt;But for logstash logs, i have the string data available under the field "message". Is it recommended to do that which doesn't include the field name over there ?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2020 03:45:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-function-itself-is-not-working-when-i-did-a-splunk/m-p/460396#M191316</guid>
      <dc:creator>d942725</dc:creator>
      <dc:date>2020-02-04T03:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: replace function itself is not working when i did a splunk search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-function-itself-is-not-working-when-i-did-a-splunk/m-p/460397#M191317</link>
      <description>&lt;P&gt;This one Worked for me. Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2020 10:41:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-function-itself-is-not-working-when-i-did-a-splunk/m-p/460397#M191317</guid>
      <dc:creator>d942725</dc:creator>
      <dc:date>2020-02-04T10:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: replace function itself is not working when i did a splunk search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-function-itself-is-not-working-when-i-did-a-splunk/m-p/460398#M191318</link>
      <description>&lt;P&gt;hi  richgalloway ♦,   rex field=_raw mode=sed "s/Data\s*=\s*//"&lt;BR /&gt;
 the above one worked for me.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:01:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-function-itself-is-not-working-when-i-did-a-splunk/m-p/460398#M191318</guid>
      <dc:creator>d942725</dc:creator>
      <dc:date>2020-09-30T04:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: replace function itself is not working when i did a splunk search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-function-itself-is-not-working-when-i-did-a-splunk/m-p/460399#M191319</link>
      <description>&lt;P&gt;@d942725 Welcome :). Can you please accept the answer.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2020 16:11:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-function-itself-is-not-working-when-i-did-a-splunk/m-p/460399#M191319</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2020-02-04T16:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: replace function itself is not working when i did a splunk search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-function-itself-is-not-working-when-i-did-a-splunk/m-p/460400#M191320</link>
      <description>&lt;P&gt;Sure, Vl accept the answer. &lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2020 16:43:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-function-itself-is-not-working-when-i-did-a-splunk/m-p/460400#M191320</guid>
      <dc:creator>d942725</dc:creator>
      <dc:date>2020-02-04T16:43:17Z</dc:date>
    </item>
  </channel>
</rss>

