<?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: How to add multiple duration from multiple independent transactions in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-multiple-duration-from-multiple-independent/m-p/252808#M75646</link>
    <description>&lt;P&gt;If you're using Splunk 6.3 and above, something like this would work. (Update the queries accourdingly). (Run Anywhere sample)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;PanelsWithTokenAdd&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;single&amp;gt;
        &amp;lt;title&amp;gt;Sourcetype count&amp;lt;/title&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=_internal | stats dc(sourcetype) as sourcetypes&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;@d&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
          &amp;lt;done&amp;gt;
            &amp;lt;set token="sourcetypes"&amp;gt;$result.sourcetypes$&amp;lt;/set&amp;gt;
          &amp;lt;/done&amp;gt;
        &amp;lt;/search&amp;gt;
      &amp;lt;/single&amp;gt;
    &amp;lt;/panel&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;single&amp;gt;
        &amp;lt;title&amp;gt;Sources&amp;lt;/title&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=_internal | stats dc(source) as sources&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-60m@m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
          &amp;lt;done&amp;gt;
            &amp;lt;set token="sources"&amp;gt;$result.sources$&amp;lt;/set&amp;gt;
          &amp;lt;/done&amp;gt;
        &amp;lt;/search&amp;gt;
      &amp;lt;/single&amp;gt;
    &amp;lt;/panel&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;single&amp;gt;
        &amp;lt;title&amp;gt;Sourcetypes + Source&amp;lt;/title&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| gentimes start=-1 | eval sourcetypes="$sourcetypes$" | eval sources="$sources$" | eval all=sourcetypes+sources | table all&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;@d&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
      &amp;lt;/single&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 13 Oct 2016 03:28:23 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-10-13T03:28:23Z</dc:date>
    <item>
      <title>How to add multiple duration from multiple independent transactions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-multiple-duration-from-multiple-independent/m-p/252806#M75644</link>
      <description>&lt;P&gt;So I am running multiple single valued transactions and putting the values in eval keywords, but I want to add all these new values to get the total value (duration1+duration2+....) and show it in another panel. Here is my following transactions I am running. They are all run separate inside a single row&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main host=host1 | transaction startswith="keyword1" endswith="keyword1_ending" | eval keyword1_duration = duration | stats sum(keyword1_duration)
index=main host=host1 | transaction startswith="keyword2" endswith="keyword2_ending" | eval keyword2_duration = duration | stats sum(keyword2_duration)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;how do I add these values ? Do I have to define a token on each block to use that value across panels ?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2016 23:53:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-multiple-duration-from-multiple-independent/m-p/252806#M75644</guid>
      <dc:creator>smhsplunk</dc:creator>
      <dc:date>2016-10-12T23:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to add multiple duration from multiple independent transactions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-multiple-duration-from-multiple-independent/m-p/252807#M75645</link>
      <description>&lt;P&gt;Can an event have more than one keyword (start or end)?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 00:17:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-multiple-duration-from-multiple-independent/m-p/252807#M75645</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-10-13T00:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to add multiple duration from multiple independent transactions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-multiple-duration-from-multiple-independent/m-p/252808#M75646</link>
      <description>&lt;P&gt;If you're using Splunk 6.3 and above, something like this would work. (Update the queries accourdingly). (Run Anywhere sample)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;PanelsWithTokenAdd&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;single&amp;gt;
        &amp;lt;title&amp;gt;Sourcetype count&amp;lt;/title&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=_internal | stats dc(sourcetype) as sourcetypes&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;@d&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
          &amp;lt;done&amp;gt;
            &amp;lt;set token="sourcetypes"&amp;gt;$result.sourcetypes$&amp;lt;/set&amp;gt;
          &amp;lt;/done&amp;gt;
        &amp;lt;/search&amp;gt;
      &amp;lt;/single&amp;gt;
    &amp;lt;/panel&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;single&amp;gt;
        &amp;lt;title&amp;gt;Sources&amp;lt;/title&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=_internal | stats dc(source) as sources&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-60m@m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
          &amp;lt;done&amp;gt;
            &amp;lt;set token="sources"&amp;gt;$result.sources$&amp;lt;/set&amp;gt;
          &amp;lt;/done&amp;gt;
        &amp;lt;/search&amp;gt;
      &amp;lt;/single&amp;gt;
    &amp;lt;/panel&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;single&amp;gt;
        &amp;lt;title&amp;gt;Sourcetypes + Source&amp;lt;/title&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| gentimes start=-1 | eval sourcetypes="$sourcetypes$" | eval sources="$sources$" | eval all=sourcetypes+sources | table all&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;@d&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
      &amp;lt;/single&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Oct 2016 03:28:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-multiple-duration-from-multiple-independent/m-p/252808#M75646</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-10-13T03:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to add multiple duration from multiple independent transactions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-multiple-duration-from-multiple-independent/m-p/252809#M75647</link>
      <description>&lt;P&gt;Great this works! How do I put default value of tokens to zero ?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 17:19:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-multiple-duration-from-multiple-independent/m-p/252809#M75647</guid>
      <dc:creator>smhsplunk</dc:creator>
      <dc:date>2016-10-13T17:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to add multiple duration from multiple independent transactions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-multiple-duration-from-multiple-independent/m-p/252810#M75648</link>
      <description>&lt;P&gt;Try replacing &lt;CODE&gt;| eval all=sourcetypes+sources&lt;/CODE&gt; with &lt;CODE&gt;| eval all=coalesce(sourcetypes+sources,0)&lt;/CODE&gt; in 3rd panel search.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 18:13:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-multiple-duration-from-multiple-independent/m-p/252810#M75648</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-10-13T18:13:35Z</dc:date>
    </item>
  </channel>
</rss>

