<?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: Is it possible to extract results of an eval match as fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-extract-results-of-an-eval-match-as-fields/m-p/227135#M67047</link>
    <description>&lt;P&gt;Hi, did any of the comments below help you on this?&lt;BR /&gt;
If yes, can you mark it as answered?&lt;BR /&gt;
If not, is there any else we can do to help?&lt;BR /&gt;
Unanswered questions make me sad &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 09 May 2016 16:36:00 GMT</pubDate>
    <dc:creator>javiergn</dc:creator>
    <dc:date>2016-05-09T16:36:00Z</dc:date>
    <item>
      <title>Is it possible to extract results of an eval match as fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-extract-results-of-an-eval-match-as-fields/m-p/227130#M67042</link>
      <description>&lt;P&gt;Is it possible to do something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|eval Classification=case(match(class,"Boy"),"Boy",match(class,"Girl"),"Girl",match(class,"Man"),"Man") |code_I_am_looking_for | stats count by Boy,Girl,Man
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Sun, 01 May 2016 15:47:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-extract-results-of-an-eval-match-as-fields/m-p/227130#M67042</guid>
      <dc:creator>ibekacyril</dc:creator>
      <dc:date>2016-05-01T15:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to extract results of an eval match as fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-extract-results-of-an-eval-match-as-fields/m-p/227131#M67043</link>
      <description>&lt;P&gt;Have you tried just &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|eval Classification=case(match(class,"Boy"),"Boy",match(class,"Girl"),"Girl",match(class,"Man"),"Man")  | stats count by Classification
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;?&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2016 01:09:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-extract-results-of-an-eval-match-as-fields/m-p/227131#M67043</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2016-05-02T01:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to extract results of an eval match as fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-extract-results-of-an-eval-match-as-fields/m-p/227132#M67044</link>
      <description>&lt;P&gt;No, that's not what I want. Doing a stat count by classification lists Boy,Girl,Man under Classification. I want to split the match into fields if possible, then do stats count on the new fields&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2016 01:35:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-extract-results-of-an-eval-match-as-fields/m-p/227132#M67044</guid>
      <dc:creator>ibekacyril</dc:creator>
      <dc:date>2016-05-02T01:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to extract results of an eval match as fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-extract-results-of-an-eval-match-as-fields/m-p/227133#M67045</link>
      <description>&lt;P&gt;Have you tried with chart?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Classification=case(match(class,"Boy"),"Boy",match(class,"Girl"),"Girl",match(class,"Man"),"Man")
| chart count over class by Classification
| fields - class
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Alternatively, if you you know the name of your fields in advanced you could also do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Classification=case(match(class,"Boy"),"Boy",match(class,"Girl"),"Girl",match(class,"Man"),"Man")
| eval Boy = if (Classification == "Boy", 1, 0)
| eval Girl = if (Classification == "Girl", 1, 0)
| eval Man = if (Classification == "Man", 1, 0)
| stats sum(*) as *
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 May 2016 05:08:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-extract-results-of-an-eval-match-as-fields/m-p/227133#M67045</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-05-02T05:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to extract results of an eval match as fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-extract-results-of-an-eval-match-as-fields/m-p/227134#M67046</link>
      <description>&lt;P&gt;From your response to my other Answer, maybe this answer will suit your need better.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats count(eval(match(class, "Boy"))) AS "Boy" count(eval(match(class, "Girl"))) AS "Girl" count(eval(match(class, "Man"))) AS "Man"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That gets rid of a lot of complexity but should end up with an output like your description "I want to split the match into fields if possible, then do stats count on the new fields"&lt;/P&gt;

&lt;P&gt;Give that a try and let us know!  &lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2016 14:04:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-extract-results-of-an-eval-match-as-fields/m-p/227134#M67046</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2016-05-02T14:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to extract results of an eval match as fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-extract-results-of-an-eval-match-as-fields/m-p/227135#M67047</link>
      <description>&lt;P&gt;Hi, did any of the comments below help you on this?&lt;BR /&gt;
If yes, can you mark it as answered?&lt;BR /&gt;
If not, is there any else we can do to help?&lt;BR /&gt;
Unanswered questions make me sad &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2016 16:36:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-extract-results-of-an-eval-match-as-fields/m-p/227135#M67047</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-05-09T16:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to extract results of an eval match as fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-extract-results-of-an-eval-match-as-fields/m-p/227136#M67048</link>
      <description>&lt;P&gt;Hi Javiergn, sorry about the late response, your answer was very helpful&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2016 02:36:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-extract-results-of-an-eval-match-as-fields/m-p/227136#M67048</guid>
      <dc:creator>ibekacyril</dc:creator>
      <dc:date>2016-05-18T02:36:31Z</dc:date>
    </item>
  </channel>
</rss>

