<?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: Search &amp; timechart: faster and slower when using fields command? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-timechart-faster-and-slower-when-using-fields-command/m-p/413121#M119127</link>
    <description>&lt;P&gt;Not entirely sure what exactly you are saying with which is faster when. But consider these things:&lt;/P&gt;

&lt;P&gt;When running as a dashboard, it typically runs in fast mode, so no field extractions. So much faster than when running it as a normal search (which typically uses smart mode). Using the &lt;CODE&gt;fields&lt;/CODE&gt; command, you limit the extractions performed, making the search in smart mode much faster.&lt;/P&gt;

&lt;P&gt;In general, this type of simple counting is best done using tstats:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count where index=myindex by _time span=10m | timechart span=10m sum(count)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or combined into one search for both indexes:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count where index=domain OR index="infected domains" by _time,index span=10m | timechart span=10m sum(count) by index
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 28 Nov 2018 09:53:32 GMT</pubDate>
    <dc:creator>FrankVl</dc:creator>
    <dc:date>2018-11-28T09:53:32Z</dc:date>
    <item>
      <title>Search &amp; timechart: faster and slower when using fields command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-timechart-faster-and-slower-when-using-fields-command/m-p/413120#M119126</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;

&lt;P&gt;I have an index with more than 25 million events (and there are going to be more). There is a saved search that inserts into an auxiliary summary index with some events based on a custom lookup (big index=domains, summary index=infected domains). I tried to make a timechart (with the count of all the events) with an overlay chart where the line represents only the infected ones.&lt;/P&gt;

&lt;P&gt;However, for the last 24h (with about 15M events), the timechart commands takes forever. I observed the following behaviour:&lt;/P&gt;

&lt;P&gt;This search...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="myindex"
| fields ip
| timechart span=10m count(_raw)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...is much more faster than when used in a timechart panel (in the search there are batches of 100.000+ events at a time). However, &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="myindex"
| timechart span=10m count(_raw)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...is much faster when creating the timechart and very slow (batches of 10.000 events) when used with search.&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Why is that and what's the best method to create a time chart when having a lot of events?&lt;/LI&gt;
&lt;LI&gt;Does is affect other chart types too? If yes, what's the best practice?&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 09:09:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-timechart-faster-and-slower-when-using-fields-command/m-p/413120#M119126</guid>
      <dc:creator>orinciog</dc:creator>
      <dc:date>2018-11-28T09:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: Search &amp; timechart: faster and slower when using fields command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-timechart-faster-and-slower-when-using-fields-command/m-p/413121#M119127</link>
      <description>&lt;P&gt;Not entirely sure what exactly you are saying with which is faster when. But consider these things:&lt;/P&gt;

&lt;P&gt;When running as a dashboard, it typically runs in fast mode, so no field extractions. So much faster than when running it as a normal search (which typically uses smart mode). Using the &lt;CODE&gt;fields&lt;/CODE&gt; command, you limit the extractions performed, making the search in smart mode much faster.&lt;/P&gt;

&lt;P&gt;In general, this type of simple counting is best done using tstats:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count where index=myindex by _time span=10m | timechart span=10m sum(count)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or combined into one search for both indexes:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count where index=domain OR index="infected domains" by _time,index span=10m | timechart span=10m sum(count) by index
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Nov 2018 09:53:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-timechart-faster-and-slower-when-using-fields-command/m-p/413121#M119127</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-11-28T09:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: Search &amp; timechart: faster and slower when using fields command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-timechart-faster-and-slower-when-using-fields-command/m-p/413122#M119128</link>
      <description>&lt;P&gt;Because timechart is a transforming command. See &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.2.1/SearchReference/Commandsbytype"&gt;Splunk's command types&lt;/A&gt;&lt;BR /&gt;
.&lt;/P&gt;

&lt;P&gt;What you probably want to use, is &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.2.1/SearchReference/Sitimechart"&gt;sitimechart&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;Skalli&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 10:13:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-timechart-faster-and-slower-when-using-fields-command/m-p/413122#M119128</guid>
      <dc:creator>skalliger</dc:creator>
      <dc:date>2018-11-28T10:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: Search &amp; timechart: faster and slower when using fields command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-timechart-faster-and-slower-when-using-fields-command/m-p/413123#M119129</link>
      <description>&lt;P&gt;That's exactly what I needed!&lt;BR /&gt;
The results in the timechart were instant. &lt;BR /&gt;
Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 10:29:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-timechart-faster-and-slower-when-using-fields-command/m-p/413123#M119129</guid>
      <dc:creator>orinciog</dc:creator>
      <dc:date>2018-11-28T10:29:02Z</dc:date>
    </item>
    <item>
      <title>Re: Search &amp; timechart: faster and slower when using fields command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-timechart-faster-and-slower-when-using-fields-command/m-p/413124#M119130</link>
      <description>&lt;P&gt;@FrankVl is there a way to assign custom name to each of the series (instead of the name of the index)?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 10:37:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-timechart-faster-and-slower-when-using-fields-command/m-p/413124#M119130</guid>
      <dc:creator>orinciog</dc:creator>
      <dc:date>2018-11-28T10:37:11Z</dc:date>
    </item>
  </channel>
</rss>

