<?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: Back-computation using table contents in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Back-computation-using-table-contents/m-p/494851#M137916</link>
    <description>&lt;P&gt;*Minor changes to my code:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;source="/tmp/categories.csv" host="pc1" index="my_index" Category=Biology | eval Subject=Sub_category | table Category Subject&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
    <pubDate>Wed, 30 Sep 2020 04:37:14 GMT</pubDate>
    <dc:creator>vigneshtv</dc:creator>
    <dc:date>2020-09-30T04:37:14Z</dc:date>
    <item>
      <title>Back-computation using table contents</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Back-computation-using-table-contents/m-p/494850#M137915</link>
      <description>&lt;P&gt;I have categories.csv that contains list of sub-categories in each category&lt;/P&gt;

&lt;P&gt;Category,Sub_category&lt;BR /&gt;
Biology,Botany&lt;BR /&gt;
Biology,Zoology&lt;BR /&gt;
Physical_Science,Physics&lt;BR /&gt;
Physical_Science,Chemistry&lt;/P&gt;

&lt;P&gt;In another file I have the results for all sub-categories&lt;/P&gt;

&lt;P&gt;Subject,Result&lt;BR /&gt;
Botany,Pass&lt;BR /&gt;
Zoology,Fail&lt;BR /&gt;
Physics,Being_revaluted&lt;BR /&gt;
Chemistry,Pass&lt;/P&gt;

&lt;P&gt;I need to compute the overall result per category like&lt;/P&gt;

&lt;P&gt;Biology,Physical_Science&lt;BR /&gt;
Fail,Being_revaluted&lt;/P&gt;

&lt;P&gt;Please help me achieve the above mentioned objective&lt;/P&gt;

&lt;P&gt;I am able to extract the list of sub-categories in any particular category, say Biology, using the below code&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;source="/tmp/categories.csv" host="pc1" index="my_index" Category="Biology" | eval Sub_cat=Sub_category | search Category=Biology | table Category Sub_cat&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;The above code gives&lt;/P&gt;

&lt;P&gt;Category,Sub_cat&lt;BR /&gt;
Biology,Botony&lt;BR /&gt;
Biology,Zoology&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:37:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Back-computation-using-table-contents/m-p/494850#M137915</guid>
      <dc:creator>vigneshtv</dc:creator>
      <dc:date>2020-09-30T04:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: Back-computation using table contents</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Back-computation-using-table-contents/m-p/494851#M137916</link>
      <description>&lt;P&gt;*Minor changes to my code:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;source="/tmp/categories.csv" host="pc1" index="my_index" Category=Biology | eval Subject=Sub_category | table Category Subject&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:37:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Back-computation-using-table-contents/m-p/494851#M137916</guid>
      <dc:creator>vigneshtv</dc:creator>
      <dc:date>2020-09-30T04:37:14Z</dc:date>
    </item>
    <item>
      <title>Re: Back-computation using table contents</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Back-computation-using-table-contents/m-p/494852#M137917</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="/tmp/categories.csv" host="pc1" index="my_index" Category="Biology" 
| fields Category Sub_category 
| append 
    [ search source="/tmp/sub-categories.csv" host="pc1" index="my_index" 
    | eval Sub_category= Subject 
    | fields Sub_category, Result] 
| stats values(*) as * by Sub_category
| xyseries Sub_category Category Result
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Mar 2020 05:14:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Back-computation-using-table-contents/m-p/494852#M137917</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-03-12T05:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Back-computation using table contents</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Back-computation-using-table-contents/m-p/494853#M137918</link>
      <description>&lt;P&gt;Using your code, I am getting the results in terms of sub-categories like&lt;/P&gt;

&lt;P&gt;Sub_category,Category,Result&lt;BR /&gt;
Botany,Biology,Pass&lt;BR /&gt;
Zoology,Biology,Fail ...&lt;/P&gt;

&lt;P&gt;But I need them only in-terms of categories like&lt;/P&gt;

&lt;P&gt;Biology,Physical_Science&lt;BR /&gt;
Fail,Being_revaluted&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;Fail + Fail/Pass/Being_revaluted  = Fail, &lt;BR /&gt;
Pass + Pass = Pass, &lt;BR /&gt;
Pass +  Being_revaluted = Being_revaluted&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:37:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Back-computation-using-table-contents/m-p/494853#M137918</guid>
      <dc:creator>vigneshtv</dc:creator>
      <dc:date>2020-09-30T04:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: Back-computation using table contents</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Back-computation-using-table-contents/m-p/494854#M137919</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="/tmp/categories.csv" host="pc1" index="my_index" Category="Biology" 
| fields Category Sub_category 
| append 
    [ search source="/tmp/sub-categories.csv" host="pc1" index="my_index" 
    | eval Sub_category= Subject 
    | fields Sub_category, Result] 
| stats values(*) as * by Sub_category 
| stats values(Result) as Result by Category 
| eval Result=case(match(Result, "Fail"), "Fail", match(Result, "Being_revaluted"), "Being_revaluted", 1==1, "Pass")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Mar 2020 07:58:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Back-computation-using-table-contents/m-p/494854#M137919</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-03-12T07:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: Back-computation using table contents</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Back-computation-using-table-contents/m-p/494855#M137920</link>
      <description>&lt;P&gt;Something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup AnotherFileWithResults.csv
| lookup categories.csv Sub_category AS Subject
| chart count BY Category Result
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 15 Mar 2020 01:51:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Back-computation-using-table-contents/m-p/494855#M137920</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-03-15T01:51:59Z</dc:date>
    </item>
  </channel>
</rss>

