<?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 conditional switch in splunk in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/conditional-switch-in-splunk/m-p/20569#M3240</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a splunk query which reads a log file and returns a list of values to a chart. However I need to values to be more "readable".&lt;BR /&gt;
e.g. &lt;STRONG&gt;output&lt;/STRONG&gt;: &lt;BR /&gt;
$#@VALUE_1 ===&amp;gt; ONE&lt;/P&gt;

&lt;P&gt;$#@VALUE_2 ===&amp;gt; TWO&lt;/P&gt;

&lt;P&gt;$#@VALUE_3 ===&amp;gt; THREE&lt;/P&gt;

&lt;P&gt;is there a way to say "if the value is $_VALUE_1, then output "ONE", else if the value is $_VALUE_2 then output "TWO"?&lt;/P&gt;

&lt;P&gt;I am not able to modify what is written to the actual log&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 09:38:12 GMT</pubDate>
    <dc:creator>a_dev</dc:creator>
    <dc:date>2020-09-28T09:38:12Z</dc:date>
    <item>
      <title>conditional switch in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/conditional-switch-in-splunk/m-p/20569#M3240</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a splunk query which reads a log file and returns a list of values to a chart. However I need to values to be more "readable".&lt;BR /&gt;
e.g. &lt;STRONG&gt;output&lt;/STRONG&gt;: &lt;BR /&gt;
$#@VALUE_1 ===&amp;gt; ONE&lt;/P&gt;

&lt;P&gt;$#@VALUE_2 ===&amp;gt; TWO&lt;/P&gt;

&lt;P&gt;$#@VALUE_3 ===&amp;gt; THREE&lt;/P&gt;

&lt;P&gt;is there a way to say "if the value is $_VALUE_1, then output "ONE", else if the value is $_VALUE_2 then output "TWO"?&lt;/P&gt;

&lt;P&gt;I am not able to modify what is written to the actual log&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:38:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/conditional-switch-in-splunk/m-p/20569#M3240</guid>
      <dc:creator>a_dev</dc:creator>
      <dc:date>2020-09-28T09:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: conditional switch in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/conditional-switch-in-splunk/m-p/20570#M3241</link>
      <description>&lt;P&gt;You can use "eval"/"case" to create a new field with the desired value.  This assumes those values are in the same existing field&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval new_field=case(old_field == "$_VALUE_1", "ONE", old_field == "$_VALUE_2", "TWO")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Jun 2011 13:11:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/conditional-switch-in-splunk/m-p/20570#M3241</guid>
      <dc:creator>mw</dc:creator>
      <dc:date>2011-06-01T13:11:43Z</dc:date>
    </item>
  </channel>
</rss>

