<?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: Setting field value based on another field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Setting-field-value-based-on-another-field/m-p/487851#M141572</link>
    <description>&lt;P&gt;Hi @tsheets13,&lt;BR /&gt;
you have to use eval command with case option:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval desc=case(type="1","pre",type="2","current",type="3","post")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;for more infos see at &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.2/SearchReference/ConditionalFunctions"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.2/SearchReference/ConditionalFunctions&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Thu, 05 Mar 2020 16:16:44 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2020-03-05T16:16:44Z</dc:date>
    <item>
      <title>Setting field value based on another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Setting-field-value-based-on-another-field/m-p/487850#M141571</link>
      <description>&lt;P&gt;I have a value in my events called type, which is a single digit integer (1, 2, 3, etc.)&lt;/P&gt;
&lt;P&gt;I would like to create a new string field in my search based on that value.&lt;/P&gt;
&lt;P&gt;So, something like this pseudocode...&lt;/P&gt;
&lt;P&gt;if type = 1 then desc = "pre"&lt;BR /&gt;if type = 2 then desc = "current"&lt;BR /&gt;if type = 3 then desc = "post"&lt;/P&gt;
&lt;P&gt;I realize the splunk doesn't do if/then statements but I thought that was the easiest way to explain.&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2020 18:40:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Setting-field-value-based-on-another-field/m-p/487850#M141571</guid>
      <dc:creator>tsheets13</dc:creator>
      <dc:date>2020-06-24T18:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Setting field value based on another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Setting-field-value-based-on-another-field/m-p/487851#M141572</link>
      <description>&lt;P&gt;Hi @tsheets13,&lt;BR /&gt;
you have to use eval command with case option:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval desc=case(type="1","pre",type="2","current",type="3","post")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;for more infos see at &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.2/SearchReference/ConditionalFunctions"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.2/SearchReference/ConditionalFunctions&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 16:16:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Setting-field-value-based-on-another-field/m-p/487851#M141572</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-03-05T16:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: Setting field value based on another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Setting-field-value-based-on-another-field/m-p/487852#M141573</link>
      <description>&lt;P&gt;Perfect!  Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 18:07:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Setting-field-value-based-on-another-field/m-p/487852#M141573</guid>
      <dc:creator>tsheets13</dc:creator>
      <dc:date>2020-03-05T18:07:23Z</dc:date>
    </item>
  </channel>
</rss>

