<?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: Evaluating multiple fields to create new field based on priority in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-evaluate-multiple-fields-to-create-new-field-based-on/m-p/607432#M211179</link>
    <description>&lt;P&gt;I knew it was easy &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jul 2022 22:48:10 GMT</pubDate>
    <dc:creator>raysonjoberts</dc:creator>
    <dc:date>2022-07-28T22:48:10Z</dc:date>
    <item>
      <title>How to evaluate multiple fields to create new field based on priority?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-evaluate-multiple-fields-to-create-new-field-based-on/m-p/607408#M211171</link>
      <description>&lt;P&gt;I am trying to create a logic to choose a value to use from multiple fields based on a priority I can define. I have 3 fields which may have values in them and I want to create a 4th field to represent the best best choice of the 3.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I always trust field3 more than field2 and always trust field2 more than field1.&amp;nbsp; I want the logic to be -&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- if field3 has value, always use it&lt;BR /&gt;-if field3 has no value, use field2's value&lt;BR /&gt;-if field3 and field2 have no values, use field1's value&lt;BR /&gt;- if fields3, 2 and 1 all have no values, leave blank (or "unknown", etc.)&lt;BR /&gt;&lt;BR /&gt;These are 3 examples of what this may look like and what I want to see field4 be based on the presence of values in the other fields.&lt;/P&gt;
&lt;P&gt;Example 1&lt;BR /&gt;field1=&amp;lt;value1&amp;gt;&lt;BR /&gt;field2=&amp;lt;value2&amp;gt;&lt;BR /&gt;field3=&amp;lt;value3&amp;gt;&lt;BR /&gt;field4=&lt;STRONG&gt;&amp;lt;value3&amp;gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Example 2&lt;BR /&gt;field1=&amp;lt;value1&amp;gt;&lt;BR /&gt;field2=&amp;lt;value2&amp;gt;&lt;BR /&gt;field3=&lt;BR /&gt;field4=&lt;STRONG&gt;&amp;lt;value2&amp;gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Example3&lt;BR /&gt;field1=&amp;lt;value1&amp;gt;&lt;BR /&gt;field2=&lt;BR /&gt;field3=&lt;BR /&gt;field4=&lt;STRONG&gt;&amp;lt;value1&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I feel like this is probably a pretty pretty simple eval command, but I can't seem to find an example.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Thank you in advance!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 05:51:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-evaluate-multiple-fields-to-create-new-field-based-on/m-p/607408#M211171</guid>
      <dc:creator>raysonjoberts</dc:creator>
      <dc:date>2022-07-29T05:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluating multiple fields to create new field based on priority</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-evaluate-multiple-fields-to-create-new-field-based-on/m-p/607410#M211173</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval field4=coalesce(field3, field2, field1)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 28 Jul 2022 17:48:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-evaluate-multiple-fields-to-create-new-field-based-on/m-p/607410#M211173</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-07-28T17:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluating multiple fields to create new field based on priority</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-evaluate-multiple-fields-to-create-new-field-based-on/m-p/607432#M211179</link>
      <description>&lt;P&gt;I knew it was easy &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 22:48:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-evaluate-multiple-fields-to-create-new-field-based-on/m-p/607432#M211179</guid>
      <dc:creator>raysonjoberts</dc:creator>
      <dc:date>2022-07-28T22:48:10Z</dc:date>
    </item>
  </channel>
</rss>

