<?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 generate multiple charts from one search result faster? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-multiple-charts-from-one-search-result-faster/m-p/175748#M50471</link>
    <description>&lt;P&gt;i meany &lt;CODE&gt;index=*&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Jan 2015 04:03:15 GMT</pubDate>
    <dc:creator>Raghav2384</dc:creator>
    <dc:date>2015-01-08T04:03:15Z</dc:date>
    <item>
      <title>How to generate multiple charts from one search result faster?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-multiple-charts-from-one-search-result-faster/m-p/175744#M50467</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm wondering if there is any faster or more efficient way (either using Pivot or some unique query) to generate multiple charts.&lt;/P&gt;

&lt;P&gt;The base query is really simple:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|stats count by src dst port
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and on dashboard, I made three panels:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;|stats count by src|sort -count|head 10&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;|stats count by dst|sort -count|head 10&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;|stats count by port|sort -count|head 10&lt;/CODE&gt;&lt;BR /&gt;
which takes about 20 minutes to load completely.&lt;/P&gt;

&lt;P&gt;I've tried Pivot by putting above query to the Data Model hoping it will load faster but it seems it's loading one by one which is not much different from loading three different searches as shown above. &lt;/P&gt;

&lt;P&gt;Is this the only way?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jan 2015 01:24:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-multiple-charts-from-one-search-result-faster/m-p/175744#M50467</guid>
      <dc:creator>hcheang</dc:creator>
      <dc:date>2015-01-08T01:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate multiple charts from one search result faster?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-multiple-charts-from-one-search-result-faster/m-p/175745#M50468</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;PostProcessSearch should help you    here. Example
       Example XML: 

    1. 

   &amp;gt; &amp;lt;search id="parent&amp;gt; &amp;lt;query&amp;gt;index=x
   &amp;gt;     sourcetype=y earliest=blah
   &amp;gt;     latest=blah|more search | stats
   &amp;gt;     count by src,dst,port,_time&amp;lt;/query&amp;gt;
   &amp;gt;     &amp;lt;/search&amp;gt;
   &amp;gt;     
   &amp;gt;     /**processed searches **/ &amp;lt;chart1&amp;gt;
   &amp;gt;     &amp;lt;search base="parent"&amp;gt; &amp;lt;query&amp;gt;stats
   &amp;gt;     count by src&amp;lt;/query&amp;gt; &amp;lt;search&amp;gt;
   &amp;gt;     &amp;lt;/chart1&amp;gt; &amp;lt;chart2&amp;gt; &amp;lt;search
   &amp;gt;     base="parent"&amp;gt; &amp;lt;query&amp;gt;stats count by
   &amp;gt;     dst&amp;lt;/query&amp;gt; &amp;lt;search&amp;gt; &amp;lt;/chart2&amp;gt;
   &amp;gt;     &amp;lt;chart3&amp;gt; &amp;lt;search base="parent"&amp;gt;
   &amp;gt;     &amp;lt;query&amp;gt;stats count by port&amp;lt;/query&amp;gt;
   &amp;gt;     &amp;lt;search&amp;gt; &amp;lt;/chart3&amp;gt;
       More information on Post process searches :    &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.1/AdvancedDev/PostProcess" target="test_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.1/AdvancedDev/PostProcess&lt;/A&gt;
       Hope this help!    Thanks,    Raghav
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Jan 2015 02:04:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-multiple-charts-from-one-search-result-faster/m-p/175745#M50468</guid>
      <dc:creator>Raghav2384</dc:creator>
      <dc:date>2015-01-08T02:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate multiple charts from one search result faster?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-multiple-charts-from-one-search-result-faster/m-p/175746#M50469</link>
      <description>&lt;P&gt;Thanks! but can you look at my code and tell me what's wrong with it? I've looked into the document but there wasn't enough example for me to understand your code. What I've tried is like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Testing&amp;lt;/label&amp;gt;
  &amp;lt;description/&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="time" token="field1"&amp;gt;
      &amp;lt;label/&amp;gt;
      &amp;lt;default&amp;gt;
        &amp;lt;earliestTime&amp;gt;0&amp;lt;/earliestTime&amp;gt;
        &amp;lt;latestTime/&amp;gt;
      &amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
        &amp;lt;search id="parent"&amp;gt; 
            &amp;lt;query&amp;gt;index=* |stats count by src dst port &amp;lt;/query&amp;gt;
            &amp;lt;earliestTime&amp;gt;$field1.earliest$&amp;lt;/earliestTime&amp;gt;
            &amp;lt;latestTime&amp;gt;$field1.latest$&amp;lt;/latestTime&amp;gt;
        &amp;lt;/search&amp;gt;          
        &amp;lt;chart1&amp;gt;
            &amp;lt;search base="parent"&amp;gt; 
            &amp;lt;query&amp;gt;stats count by src&amp;lt;/query&amp;gt; 
            &amp;lt;/search&amp;gt;
        &amp;lt;/chart1&amp;gt; 
        &amp;lt;chart2&amp;gt; 
            &amp;lt;search base="parent"&amp;gt; 
            &amp;lt;query&amp;gt;stats count by dst&amp;lt;/query&amp;gt;
            &amp;lt;/search&amp;gt; 
        &amp;lt;/chart2&amp;gt;
        &amp;lt;chart3&amp;gt; 
            &amp;lt;search base="parent"&amp;gt;
            &amp;lt;query&amp;gt;stats count by port&amp;lt;/query&amp;gt;
            &amp;lt;/search&amp;gt; 
            &amp;lt;/chart3&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Jan 2015 03:14:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-multiple-charts-from-one-search-result-faster/m-p/175746#M50469</guid>
      <dc:creator>hcheang</dc:creator>
      <dc:date>2015-01-08T03:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate multiple charts from one search result faster?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-multiple-charts-from-one-search-result-faster/m-p/175747#M50470</link>
      <description>&lt;P&gt;IMO parent search shouldn't be in any panel. Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;form&amp;gt;
       &amp;lt;label&amp;gt;Testing&amp;lt;/label&amp;gt;

       &amp;lt;fieldset submitButton="false"&amp;gt;
          &amp;lt;input type="dropdown" token="earliestTime" searchWhenChanged="true"&amp;gt;
                   &amp;lt;label&amp;gt;Select a TimeWindow&amp;lt;/label&amp;gt;
                   &amp;lt;choice value="-24h@h"&amp;gt;24 Hour Window&amp;lt;/choice&amp;gt;
                   &amp;lt;choice value="-48h@h"&amp;gt;48 Hour Window&amp;lt;/choice&amp;gt;
                   &amp;lt;choice value="-72h@h"&amp;gt;72 Hour Window&amp;lt;/choice&amp;gt;
                   &amp;lt;choice value="-7d@d"&amp;gt;7 Day Window&amp;lt;/choice&amp;gt;
                   &amp;lt;default&amp;gt;24 Hour Window&amp;lt;/default&amp;gt;
          &amp;lt;/input&amp;gt;
       &amp;lt;/fieldset&amp;gt;
    &amp;lt;search id="parent"&amp;gt; 
                 &amp;lt;query&amp;gt;index=* |stats count by src,dst,port,_time &amp;lt;/query&amp;gt;
                 &amp;lt;earliest&amp;gt;$earliestTime$&amp;lt;/earliest&amp;gt;
                 &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
    &amp;lt;/search&amp;gt;    
       &amp;lt;row&amp;gt;
         &amp;lt;panel&amp;gt;

             &amp;lt;chart&amp;gt;
                 &amp;lt;title&amp;gt;FirstChart&amp;lt;/title&amp;gt;
                 &amp;lt;search base="parent"&amp;gt; 
                 &amp;lt;query&amp;gt;stats count by src&amp;lt;/query&amp;gt; 
                 &amp;lt;/search&amp;gt;
             &amp;lt;/chart&amp;gt; 
        &amp;lt;/panel&amp;gt;
        &amp;lt;panel&amp;gt;
             &amp;lt;chart&amp;gt; 
                 &amp;lt;title&amp;gt;SecondChart&amp;lt;/title&amp;gt;
                 &amp;lt;search base="parent"&amp;gt; 
                 &amp;lt;query&amp;gt;stats count by dst&amp;lt;/query&amp;gt;
                 &amp;lt;/search&amp;gt; 
             &amp;lt;/chart&amp;gt;
        &amp;lt;/panel&amp;gt;
        &amp;lt;panel&amp;gt;
             &amp;lt;chart&amp;gt; 
                  &amp;lt;title&amp;gt;ThirdChart&amp;lt;/title&amp;gt;
                   &amp;lt;search base="parent"&amp;gt;
                 &amp;lt;query&amp;gt;stats count by port&amp;lt;/query&amp;gt;
                 &amp;lt;/search&amp;gt; 
                 &amp;lt;/chart&amp;gt;
         &amp;lt;/panel&amp;gt;
       &amp;lt;/row&amp;gt;
     &amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have added custom time ranges 24h,48h,72h and 7D instead of timepicker. Try thiss and let me know if it works.&lt;/P&gt;

&lt;P&gt;Also, index=&lt;EM&gt;|stats count by src,dst,port is your actual search? If i use index=&lt;/EM&gt; on our instance, it would die in few minutes &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Raghav&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jan 2015 03:51:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-multiple-charts-from-one-search-result-faster/m-p/175747#M50470</guid>
      <dc:creator>Raghav2384</dc:creator>
      <dc:date>2015-01-08T03:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate multiple charts from one search result faster?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-multiple-charts-from-one-search-result-faster/m-p/175748#M50471</link>
      <description>&lt;P&gt;i meany &lt;CODE&gt;index=*&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jan 2015 04:03:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-multiple-charts-from-one-search-result-faster/m-p/175748#M50471</guid>
      <dc:creator>Raghav2384</dc:creator>
      <dc:date>2015-01-08T04:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate multiple charts from one search result faster?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-multiple-charts-from-one-search-result-faster/m-p/175749#M50472</link>
      <description>&lt;P&gt;I get "No search query provided." messages for all three charts.. and yes I use index=some firewall and specify host= something but didn't included in the example sorry XD. I'll try to find fix this but really you've been a great help with this question and the previous one. Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jan 2015 04:29:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-multiple-charts-from-one-search-result-faster/m-p/175749#M50472</guid>
      <dc:creator>hcheang</dc:creator>
      <dc:date>2015-01-08T04:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate multiple charts from one search result faster?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-multiple-charts-from-one-search-result-faster/m-p/175750#M50473</link>
      <description>&lt;P&gt;Couple you please post your xml? please grey out the index and host info. I have used the same xml and get the resuts as i wanted. Interesting.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jan 2015 04:34:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-multiple-charts-from-one-search-result-faster/m-p/175750#M50473</guid>
      <dc:creator>Raghav2384</dc:creator>
      <dc:date>2015-01-08T04:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate multiple charts from one search result faster?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-multiple-charts-from-one-search-result-faster/m-p/175751#M50474</link>
      <description>&lt;P&gt;Sorry for late reply. Am I doing something wrong? The way I'm creating the dashboard is Dashboards&amp;gt;Create New Dashboard&amp;gt;Edit Source&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
        &amp;lt;label&amp;gt;Testing&amp;lt;/label&amp;gt;

        &amp;lt;fieldset submitButton="false"&amp;gt;
           &amp;lt;input type="dropdown" token="earliestTime" searchWhenChanged="true"&amp;gt;
                    &amp;lt;label&amp;gt;Select a TimeWindow&amp;lt;/label&amp;gt;
                    &amp;lt;choice value="-24h@h"&amp;gt;24 Hour Window&amp;lt;/choice&amp;gt;
                    &amp;lt;choice value="-48h@h"&amp;gt;48 Hour Window&amp;lt;/choice&amp;gt;
                    &amp;lt;choice value="-72h@h"&amp;gt;72 Hour Window&amp;lt;/choice&amp;gt;
                    &amp;lt;choice value="-7d@d"&amp;gt;7 Day Window&amp;lt;/choice&amp;gt;
                    &amp;lt;default&amp;gt;24 Hour Window&amp;lt;/default&amp;gt;
           &amp;lt;/input&amp;gt;
        &amp;lt;/fieldset&amp;gt;
     &amp;lt;search id="parent"&amp;gt; 
                  &amp;lt;query&amp;gt;index=someindex action=DENY |stats count by src dst port_dest _time &amp;lt;/query&amp;gt;
                  &amp;lt;earliest&amp;gt;$earliestTime$&amp;lt;/earliest&amp;gt;
                  &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
     &amp;lt;/search&amp;gt;    
        &amp;lt;row&amp;gt;
          &amp;lt;panel&amp;gt;

              &amp;lt;chart&amp;gt;
                  &amp;lt;title&amp;gt;FirstChart&amp;lt;/title&amp;gt;
                  &amp;lt;search base="parent"&amp;gt; 
                  &amp;lt;query&amp;gt;|stats count by src&amp;lt;/query&amp;gt; 
                  &amp;lt;/search&amp;gt;
              &amp;lt;/chart&amp;gt; 
              &amp;lt;chart&amp;gt; 
                  &amp;lt;title&amp;gt;SecondChart&amp;lt;/title&amp;gt;
                  &amp;lt;search base="parent"&amp;gt; 
                  &amp;lt;query&amp;gt;|stats count by dst&amp;lt;/query&amp;gt;
                  &amp;lt;/search&amp;gt; 
              &amp;lt;/chart&amp;gt;
              &amp;lt;chart&amp;gt; 
                   &amp;lt;title&amp;gt;ThirdChart&amp;lt;/title&amp;gt;
                    &amp;lt;search base="parent"&amp;gt;
                  &amp;lt;query&amp;gt;|stats count by port_dest&amp;lt;/query&amp;gt;
                  &amp;lt;/search&amp;gt; 
                  &amp;lt;/chart&amp;gt;
          &amp;lt;/panel&amp;gt;
        &amp;lt;/row&amp;gt;
      &amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Jan 2015 21:08:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-multiple-charts-from-one-search-result-faster/m-p/175751#M50474</guid>
      <dc:creator>hcheang</dc:creator>
      <dc:date>2015-01-08T21:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate multiple charts from one search result faster?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-multiple-charts-from-one-search-result-faster/m-p/175752#M50475</link>
      <description>&lt;P&gt;Add ',' while using stats &lt;BR /&gt;
    stats count by src,dst,port_dest,_time&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Also, tricky part here is, if any of the values src, dst,port_dest,_time doesn't exit in your base search results, it's not going to work.
Try running individual searches like index=* earliest=-1h|stats count by src and see if it returns anything. Similarily do it for stats count by dst  and stats count by port_dest.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If one the fields doesn't return anything, exclude that from your parent search and try. &lt;/P&gt;

&lt;P&gt;Hope this helps!&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Raghav&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:35:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-multiple-charts-from-one-search-result-faster/m-p/175752#M50475</guid>
      <dc:creator>Raghav2384</dc:creator>
      <dc:date>2020-09-28T18:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate multiple charts from one search result faster?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-multiple-charts-from-one-search-result-faster/m-p/175753#M50476</link>
      <description>&lt;P&gt;This works great. Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2019 16:52:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-multiple-charts-from-one-search-result-faster/m-p/175753#M50476</guid>
      <dc:creator>richielynch89</dc:creator>
      <dc:date>2019-04-11T16:52:30Z</dc:date>
    </item>
  </channel>
</rss>

