<?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: Multiple field values combined into two different fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Multiple-field-values-combined-into-two-different-fields/m-p/526704#M148667</link>
    <description>&lt;P&gt;How about&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval success=if(in(Message,"2","4","6","10","12"),Message,null)
| eval failure=if(in(Message,"1","3","5","9","13"),Message,null)
| stats values(success) values(failure)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Oct 2020 19:23:38 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2020-10-27T19:23:38Z</dc:date>
    <item>
      <title>Multiple field values combined into two different fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-field-values-combined-into-two-different-fields/m-p/526689#M148661</link>
      <description>&lt;P&gt;Hello Splunkers&lt;BR /&gt;&lt;BR /&gt;I have the following field: Message&lt;/P&gt;&lt;P&gt;The Message fields have the following values:&amp;nbsp; 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15&lt;BR /&gt;&lt;BR /&gt;I need to create two additional fields:&amp;nbsp; Success and Failure&lt;BR /&gt;&lt;BR /&gt;Values for Success are: 2,4,6,10, &amp;amp; 12&lt;BR /&gt;Values for Failure are: 1,3,5,9,13&lt;BR /&gt;&lt;BR /&gt;All unused values are ignored and not included in either the Success or Failure field.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I have tried the following:&lt;BR /&gt;| eval&amp;nbsp; status=if(in(Message,"2","4","6","10","12"),"Success","Failure")&lt;BR /&gt;&lt;BR /&gt;This does two things:&amp;nbsp; The eval statement groups all the values in Success, correctly.&amp;nbsp; However, the eval statement groups all the values in Failure, incorrectly (by including all values other than 2,4,6,10, &amp;amp; 12).&amp;nbsp; Additionally, it groups these into a single field with two values, Success &amp;amp; Failure.&amp;nbsp; However, I would prefer to create two new fields with just the selected values for Success &amp;amp; Failure.&lt;BR /&gt;&lt;BR /&gt;UPDATE - I think I figured this out:&lt;BR /&gt;&lt;BR /&gt;eval success=case(Message="2","2",Message="4","4",Message="6","6",Message="10","10",Message="12","12")&lt;BR /&gt;&lt;BR /&gt;eval failure=case(Message="1","1",Message="3","3",Message="5","5",Message="9","9",Message="13","13")&lt;BR /&gt;&lt;BR /&gt;|stats values(success) values(failures) to validate.&lt;BR /&gt;&lt;BR /&gt;Is there a better way to do it?&amp;nbsp; Thank you!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 18:23:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-field-values-combined-into-two-different-fields/m-p/526689#M148661</guid>
      <dc:creator>jason_hotchkiss</dc:creator>
      <dc:date>2020-10-27T18:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple field values combined into two different fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-field-values-combined-into-two-different-fields/m-p/526704#M148667</link>
      <description>&lt;P&gt;How about&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval success=if(in(Message,"2","4","6","10","12"),Message,null)
| eval failure=if(in(Message,"1","3","5","9","13"),Message,null)
| stats values(success) values(failure)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 19:23:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-field-values-combined-into-two-different-fields/m-p/526704#M148667</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-10-27T19:23:38Z</dc:date>
    </item>
  </channel>
</rss>

