<?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: Eval field based on multiple fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-multiple-fields/m-p/345862#M102445</link>
    <description>&lt;P&gt;I don't quite understand your description. It sounds like you want D=C if &lt;CODE&gt;0&amp;lt;B&amp;lt;4&lt;/CODE&gt; and &lt;CODE&gt;A=1&lt;/CODE&gt;. But this is true in both of the following lines:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;A=1,B=2,C=3
A=1,B=1,C=5
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So I don't understand how you've determined that D=5 and not D=3. Can you explain?&lt;/P&gt;</description>
    <pubDate>Mon, 16 Apr 2018 16:15:22 GMT</pubDate>
    <dc:creator>elliotproebstel</dc:creator>
    <dc:date>2018-04-16T16:15:22Z</dc:date>
    <item>
      <title>Eval field based on multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-multiple-fields/m-p/345861#M102444</link>
      <description>&lt;P&gt;I have three fields A, B, C. I want to evaluate a field D that has the value of C that corresponds with the min value of B when 0 &amp;lt; B &amp;lt; 4, and A=1. How do I evaluate D? Can I use  an eval statement in stats? &lt;/P&gt;

&lt;P&gt;Example: if I have the given records with the same ID field,&lt;/P&gt;

&lt;P&gt;A=1,B=6,C=2&lt;BR /&gt;
A=1,B=2,C=3&lt;BR /&gt;
A=1,B=1,C=5,&lt;/P&gt;

&lt;P&gt;Then D=5&lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 15:57:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-multiple-fields/m-p/345861#M102444</guid>
      <dc:creator>matstap</dc:creator>
      <dc:date>2018-04-16T15:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Eval field based on multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-multiple-fields/m-p/345862#M102445</link>
      <description>&lt;P&gt;I don't quite understand your description. It sounds like you want D=C if &lt;CODE&gt;0&amp;lt;B&amp;lt;4&lt;/CODE&gt; and &lt;CODE&gt;A=1&lt;/CODE&gt;. But this is true in both of the following lines:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;A=1,B=2,C=3
A=1,B=1,C=5
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So I don't understand how you've determined that D=5 and not D=3. Can you explain?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 16:15:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-multiple-fields/m-p/345862#M102445</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-04-16T16:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: Eval field based on multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-multiple-fields/m-p/345863#M102446</link>
      <description>&lt;P&gt;I meant to write the min value of B when 0 &amp;lt; B &amp;lt; 4.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 16:20:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-multiple-fields/m-p/345863#M102446</guid>
      <dc:creator>matstap</dc:creator>
      <dc:date>2018-04-16T16:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: Eval field based on multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-multiple-fields/m-p/345864#M102447</link>
      <description>&lt;P&gt;Given your clarification, I think this should do it (assuming the ID field you mentioned is in a field called &lt;CODE&gt;unique_id&lt;/CODE&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search
| eventstats min(B) AS min_B BY unique_id
| eval D=if(B=min_B AND 0&amp;lt;B AND B&amp;lt;4 AND A=1, C, NULL)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Apr 2018 16:22:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-multiple-fields/m-p/345864#M102447</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-04-16T16:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Eval field based on multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-multiple-fields/m-p/345865#M102448</link>
      <description>&lt;P&gt;I forgot about eventstats. Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 17 Apr 2018 17:23:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-multiple-fields/m-p/345865#M102448</guid>
      <dc:creator>matstap</dc:creator>
      <dc:date>2018-04-17T17:23:48Z</dc:date>
    </item>
  </channel>
</rss>

