<?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: Reducing the relation of a report from stats in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Reducing-the-relation-of-a-report-from-stats/m-p/70873#M180735</link>
    <description>&lt;P&gt;whats the raw data look like ? i.e. do D1 and D2 exist in the same event, or are they always in seperate events ?&lt;/P&gt;</description>
    <pubDate>Fri, 21 Dec 2012 16:01:07 GMT</pubDate>
    <dc:creator>jonuwz</dc:creator>
    <dc:date>2012-12-21T16:01:07Z</dc:date>
    <item>
      <title>Reducing the relation of a report from stats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Reducing-the-relation-of-a-report-from-stats/m-p/70872#M180734</link>
      <description>&lt;P&gt;I'm sure this is a really simple one, but for some reason I can't get my head around how to format a result table in a specific way.&lt;/P&gt;

&lt;P&gt;I have a search that I run through stats. The stats command is like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats sum(started) as started sum(finished) as finished by D1 D2
D1     D2     started     finished
did1   did2   3            4
did1   no2    4            8
no1    did2   5            9
no1    no2    6            5
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I want to reduce it down, without using appends (e.g. with only eval, chart and/or stats) to a format like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Dimension    started    finished
did1         7          12
no1          11         14
did2         8          13
no2          10         13
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It's sort of like a pivot I guess...&lt;/P&gt;

&lt;P&gt;thanks in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Dec 2012 15:30:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Reducing-the-relation-of-a-report-from-stats/m-p/70872#M180734</guid>
      <dc:creator>brettcave</dc:creator>
      <dc:date>2012-12-21T15:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Reducing the relation of a report from stats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Reducing-the-relation-of-a-report-from-stats/m-p/70873#M180735</link>
      <description>&lt;P&gt;whats the raw data look like ? i.e. do D1 and D2 exist in the same event, or are they always in seperate events ?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Dec 2012 16:01:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Reducing-the-relation-of-a-report-from-stats/m-p/70873#M180735</guid>
      <dc:creator>jonuwz</dc:creator>
      <dc:date>2012-12-21T16:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: Reducing the relation of a report from stats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Reducing-the-relation-of-a-report-from-stats/m-p/70874#M180736</link>
      <description>&lt;P&gt;Anyhow, assuming that you can't simplify the original search into something more suitable for processing into the final result.&lt;/P&gt;

&lt;P&gt;Here's how to transform your current output into the output you want.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval Dimension=D1." ".D2 | fields - D1 D2 | makemv Dimension | mvexpand Dimension | stats sum(finished) as finished sum(started) as started by Dimension
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What we're doing is duplicating the values for started and finished for the values of D1 and D2 per line.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Dec 2012 16:13:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Reducing-the-relation-of-a-report-from-stats/m-p/70874#M180736</guid>
      <dc:creator>jonuwz</dc:creator>
      <dc:date>2012-12-21T16:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: Reducing the relation of a report from stats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Reducing-the-relation-of-a-report-from-stats/m-p/70875#M180737</link>
      <description>&lt;P&gt;thanks, it works great. d1 and d2 are determined from an MV field after a transaction: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | transaction visId | makemv someField | eval d1=mvfind(someField, "a_value") | eval d2=mvfind(someField, "b_value") | eval did_d1=if(isnotnull(d1), 1, 0) | eval did_d2=if(isnotnull(d2), 1, 0) | ....
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Jan 2013 11:29:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Reducing-the-relation-of-a-report-from-stats/m-p/70875#M180737</guid>
      <dc:creator>brettcave</dc:creator>
      <dc:date>2013-01-09T11:29:03Z</dc:date>
    </item>
  </channel>
</rss>

