<?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 How to replace a field if a specific value is seen in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-field-if-a-specific-value-is-seen/m-p/51811#M12556</link>
    <description>&lt;P&gt;I am trying to replace a value in my search.  For example if I get host=10.0.0.1 I want to grab the IP from src_ip=192.168.0.1.&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Tue, 05 Mar 2013 15:45:22 GMT</pubDate>
    <dc:creator>benspader</dc:creator>
    <dc:date>2013-03-05T15:45:22Z</dc:date>
    <item>
      <title>How to replace a field if a specific value is seen</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-field-if-a-specific-value-is-seen/m-p/51811#M12556</link>
      <description>&lt;P&gt;I am trying to replace a value in my search.  For example if I get host=10.0.0.1 I want to grab the IP from src_ip=192.168.0.1.&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2013 15:45:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-field-if-a-specific-value-is-seen/m-p/51811#M12556</guid>
      <dc:creator>benspader</dc:creator>
      <dc:date>2013-03-05T15:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace a field if a specific value is seen</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-field-if-a-specific-value-is-seen/m-p/51812#M12557</link>
      <description>&lt;P&gt;use an eval, and a condition like : fieldA=if(condition is fulfilled, then use value in Other fieldB, else use the pre-existing value in fieldA)&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&amp;lt; my search &amp;gt; | eval IP=if(host=="10.0.0.1",src_ip,IP)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2013 15:53:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-field-if-a-specific-value-is-seen/m-p/51812#M12557</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2013-03-05T15:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace a field if a specific value is seen</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-field-if-a-specific-value-is-seen/m-p/51813#M12558</link>
      <description>&lt;P&gt;Thank you yannK!  That was very helpful!&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2013 16:51:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-field-if-a-specific-value-is-seen/m-p/51813#M12558</guid>
      <dc:creator>benspader</dc:creator>
      <dc:date>2013-03-05T16:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace a field if a specific value is seen</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-field-if-a-specific-value-is-seen/m-p/51814#M12559</link>
      <description>&lt;P&gt;I'm trying to do exactly the same thing, but no matter what the value of the Event field, the new field evaluates to the value of MedRepoCloneMergeTimemin and not "na" as expected.&lt;/P&gt;

&lt;P&gt;| eval newfield=if(in(Event,"mock"), "na", MedRepoCloneMergeTimemin)&lt;/P&gt;

&lt;P&gt;| eval newfield=if(Event == mock, "na", MedRepoCloneMergeTimemin)&lt;/P&gt;

&lt;P&gt;What am I missing? thanks for any ideas.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2019 23:50:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-a-field-if-a-specific-value-is-seen/m-p/51814#M12559</guid>
      <dc:creator>cblanton</dc:creator>
      <dc:date>2019-07-15T23:50:34Z</dc:date>
    </item>
  </channel>
</rss>

