<?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 dynamic string in an event? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-dynamic-string-in-an-event/m-p/479149#M143225</link>
    <description>&lt;P&gt;Thanks for quick response, it is working fine... But I have around 300 different error messages, for all of then I want to replace a string it may be correlationID, Hostname,etc... Using your query, I will replace the string but the field name should be the same for all of 300 messages. How can I achieve this?&lt;/P&gt;</description>
    <pubDate>Wed, 26 Feb 2020 01:39:53 GMT</pubDate>
    <dc:creator>marisstella</dc:creator>
    <dc:date>2020-02-26T01:39:53Z</dc:date>
    <item>
      <title>How to replace a dynamic string in an event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-dynamic-string-in-an-event/m-p/479147#M143223</link>
      <description>&lt;P&gt;I want to replace a dynamic string in an event..&lt;BR /&gt;
Example: error occurred from the server ABCXYZ12345ABCXYZ under lenderprice hop...&lt;/P&gt;

&lt;P&gt;Here "ABCXYZ12345ABCXYZ" is dynamic field.  So i want to replace this string with XZXYYZZ"&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 17:59:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-dynamic-string-in-an-event/m-p/479147#M143223</guid>
      <dc:creator>marisstella</dc:creator>
      <dc:date>2020-02-25T17:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace a dynamic string in an event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-dynamic-string-in-an-event/m-p/479148#M143224</link>
      <description>&lt;P&gt;Here is the search string I used to test. Please note that &lt;CODE&gt;field=orig_field&lt;/CODE&gt; will need to be adjusted to whatever the field name is in question, can even be &lt;CODE&gt;_raw&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| makeresults | eval orig_field="error occurred from the server ABCXYZ12345ABCXYZ under lenderprice hop"&lt;BR /&gt;
| rex mode=sed field=orig_field "s/(?i)server\s+(\S+)\s+under/XZXYYZZ/g"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 18:25:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-dynamic-string-in-an-event/m-p/479148#M143224</guid>
      <dc:creator>adamsaul</dc:creator>
      <dc:date>2020-02-25T18:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace a dynamic string in an event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-dynamic-string-in-an-event/m-p/479149#M143225</link>
      <description>&lt;P&gt;Thanks for quick response, it is working fine... But I have around 300 different error messages, for all of then I want to replace a string it may be correlationID, Hostname,etc... Using your query, I will replace the string but the field name should be the same for all of 300 messages. How can I achieve this?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 01:39:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-dynamic-string-in-an-event/m-p/479149#M143225</guid>
      <dc:creator>marisstella</dc:creator>
      <dc:date>2020-02-26T01:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace a dynamic string in an event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-dynamic-string-in-an-event/m-p/479150#M143226</link>
      <description>&lt;P&gt;| makeresults | eval origin="error occurred from the server ABCXYZ12345ABCXYZ under lenderprice hop" &lt;BR /&gt;
|append[makeresults|eval origin="error occurred from the server SDFDKJ54121XV under lenderprice hop"]| rex mode=sed field=origin "s/(?i)server\s+(\S+)\s+under/server xxx-yyy under/g" &lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 03:09:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-dynamic-string-in-an-event/m-p/479150#M143226</guid>
      <dc:creator>marisstella</dc:creator>
      <dc:date>2020-02-26T03:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace a dynamic string in an event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-dynamic-string-in-an-event/m-p/479151#M143227</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;...
|rex mode=sed "s/(?&amp;lt;=server )\S+/XZXYYZZ/g"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Feb 2020 09:46:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-dynamic-string-in-an-event/m-p/479151#M143227</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-26T09:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace a dynamic string in an event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-dynamic-string-in-an-event/m-p/479152#M143228</link>
      <description>&lt;P&gt;I think, we're almost close to resolution..... Let's we have different type of error messages like this, so in every message we want replace one string like CorrelationID, hostname... so how can you replace the string on different error messages and combine as a single field. So that I can use this field anywhere in the dashboard or report?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 10:05:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-dynamic-string-in-an-event/m-p/479152#M143228</guid>
      <dc:creator>marisstella</dc:creator>
      <dc:date>2020-02-26T10:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace a dynamic string in an event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-dynamic-string-in-an-event/m-p/479153#M143229</link>
      <description>&lt;P&gt;correlationID?Hostname?&lt;BR /&gt;
I don't know.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 10:12:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-dynamic-string-in-an-event/m-p/479153#M143229</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-26T10:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace a dynamic string in an event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-dynamic-string-in-an-event/m-p/479154#M143230</link>
      <description>&lt;P&gt;No no....I have already replaced majority of the strings based on your regex or idea. &lt;BR /&gt;
Let's say, I have already wrote regex and able to replace.... Then how do I apply all the replaced strings with single fields...&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 10:50:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-dynamic-string-in-an-event/m-p/479154#M143230</guid>
      <dc:creator>marisstella</dc:creator>
      <dc:date>2020-02-26T10:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace a dynamic string in an event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-dynamic-string-in-an-event/m-p/479155#M143231</link>
      <description>&lt;P&gt;&lt;CODE&gt;all the replaced strings with single fields.&lt;/CODE&gt;&lt;BR /&gt;
I don't know what these are.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...
 | rex "(?&amp;lt;=server )(?&amp;lt;anyfields&amp;gt;\S+)"
 | eventstats values(anyfields) as anyfields
 | eval single=mvjoin(anyfields,":")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 11:10:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-dynamic-string-in-an-event/m-p/479155#M143231</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-26T11:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace a dynamic string in an event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-dynamic-string-in-an-event/m-p/479156#M143232</link>
      <description>&lt;P&gt;I'm sorry, I'm just confused. How can I apply these changes on _raw data?&lt;BR /&gt;
When I use the field as | eval _raw=error from server ABCD1234 under lp sy stem.. | rex mode=sed field=error_message "s/(?i)server\s+(\S+)/server xxx-yyy/g" &lt;BR /&gt;
This is done to _raw, but din't see any changes in the raw data., The Idea is we need to remove the duplicate errors triggering... &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:25:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-dynamic-string-in-an-event/m-p/479156#M143232</guid>
      <dc:creator>marisstella</dc:creator>
      <dc:date>2020-09-30T04:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace a dynamic string in an event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-dynamic-string-in-an-event/m-p/479157#M143233</link>
      <description>&lt;P&gt;my answer changes _raw.&lt;BR /&gt;
If &lt;CODE&gt;rex&lt;/CODE&gt; option &lt;CODE&gt;field=&lt;/CODE&gt; is not set, this works to _raw.&lt;BR /&gt;
your query has &lt;CODE&gt;field=error_message&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:21:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-dynamic-string-in-an-event/m-p/479157#M143233</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-09-30T04:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace a dynamic string in an event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-dynamic-string-in-an-event/m-p/479158#M143234</link>
      <description>&lt;P&gt;Ohh, thanks!!! It will be very useful for  L2 team...&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 11:42:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-dynamic-string-in-an-event/m-p/479158#M143234</guid>
      <dc:creator>marisstella</dc:creator>
      <dc:date>2020-02-27T11:42:06Z</dc:date>
    </item>
  </channel>
</rss>

