<?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 change a specific value of a field in my events to another value in a search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-specific-value-of-a-field-in-my-events-to/m-p/146971#M41067</link>
    <description>&lt;P&gt;This ought to get you what you want:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval status=if(status="open","new",status)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 17 Apr 2015 15:53:37 GMT</pubDate>
    <dc:creator>aweitzman</dc:creator>
    <dc:date>2015-04-17T15:53:37Z</dc:date>
    <item>
      <title>How to change a specific value of a field in my events to another value in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-specific-value-of-a-field-in-my-events-to/m-p/146970#M41066</link>
      <description>&lt;P&gt;i have these events:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;status         |    host     |         comments          |   ticket_number  ...
inprogress         fdi_pc        tiket edited(17-04-15)           08
closed             hp_pc         tiket edited(17-04-15)           123
inprogress         hp_pc         tiket edited(16-04-15)           096
open               tiwa_pc       tiket edited(15-04-15)           123
closed             hp_pc         tiket edited(14-04-15)           123
open               fdi_pc        tiket edited(18-04-15)           124
open               tiwa_pc       tiket edited(15-04-15)           123
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For example:&lt;BR /&gt;
I want to change status="open" to status="new" (note that all can be repeated).&lt;BR /&gt;
How can do it?&lt;/P&gt;

&lt;P&gt;thanks   &lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2015 15:43:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-specific-value-of-a-field-in-my-events-to/m-p/146970#M41066</guid>
      <dc:creator>fdi01</dc:creator>
      <dc:date>2015-04-17T15:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to change a specific value of a field in my events to another value in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-specific-value-of-a-field-in-my-events-to/m-p/146971#M41067</link>
      <description>&lt;P&gt;This ought to get you what you want:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval status=if(status="open","new",status)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Apr 2015 15:53:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-specific-value-of-a-field-in-my-events-to/m-p/146971#M41067</guid>
      <dc:creator>aweitzman</dc:creator>
      <dc:date>2015-04-17T15:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to change a specific value of a field in my events to another value in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-specific-value-of-a-field-in-my-events-to/m-p/146972#M41068</link>
      <description>&lt;P&gt;+1 to the above answer. &lt;/P&gt;

&lt;P&gt;You can also try something like&lt;/P&gt;

&lt;P&gt;....|replace "open" with "new" in status?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Raghav&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2015 15:56:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-specific-value-of-a-field-in-my-events-to/m-p/146972#M41068</guid>
      <dc:creator>Raghav2384</dc:creator>
      <dc:date>2015-04-17T15:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to change a specific value of a field in my events to another value in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-specific-value-of-a-field-in-my-events-to/m-p/146973#M41069</link>
      <description>&lt;P&gt;Hi fdi01, &lt;/P&gt;

&lt;P&gt;To do what you need you can use the &lt;STRONG&gt;rex&lt;/STRONG&gt; command with &lt;STRONG&gt;mode=sed&lt;/STRONG&gt; option like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=fieldName mode=sed "s/your_regex/your_replacement_string/g"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What you have to do is to filter the event as you like&amp;gt; doing this you will replace the match expression by the replacement string&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2015 15:59:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-specific-value-of-a-field-in-my-events-to/m-p/146973#M41069</guid>
      <dc:creator>stephane_cyrill</dc:creator>
      <dc:date>2015-04-17T15:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to change a specific value of a field in my events to another value in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-specific-value-of-a-field-in-my-events-to/m-p/146974#M41070</link>
      <description>&lt;P&gt;thank raghav &lt;BR /&gt;
it change all value of status &lt;BR /&gt;
but i am filtering. very thank  of you information with replace command.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Apr 2015 16:31:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-specific-value-of-a-field-in-my-events-to/m-p/146974#M41070</guid>
      <dc:creator>fdi01</dc:creator>
      <dc:date>2015-04-18T16:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to change a specific value of a field in my events to another value in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-specific-value-of-a-field-in-my-events-to/m-p/146975#M41071</link>
      <description>&lt;P&gt;If anyone is wondering about the timing of the 3 commands above (rex, replace, eval), I tested on my own dataset and results are:&lt;/P&gt;

&lt;P&gt;rex probably fastest, with rex and eval both taking about 1s in fast mode, but taking about 4s in verbose mode. &lt;BR /&gt;
replace takes about 4s in both fast and verbose mode&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2015 22:28:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-specific-value-of-a-field-in-my-events-to/m-p/146975#M41071</guid>
      <dc:creator>vcgamesii</dc:creator>
      <dc:date>2015-12-21T22:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to change a specific value of a field in my events to another value in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-specific-value-of-a-field-in-my-events-to/m-p/583669#M203251</link>
      <description>&lt;P&gt;Just another doubt on the same kind here, what if all values do not have "open" and we will have to search to remove only the value "open" while retain its other fields and values?&lt;/P&gt;</description>
      <pubDate>Fri, 04 Feb 2022 05:25:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-specific-value-of-a-field-in-my-events-to/m-p/583669#M203251</guid>
      <dc:creator>srinivas_gowda</dc:creator>
      <dc:date>2022-02-04T05:25:38Z</dc:date>
    </item>
  </channel>
</rss>

