<?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 build a summary index that uses eval statements to configure timechart results? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-summary-index-that-uses-eval-statements-to/m-p/397833#M115444</link>
    <description>&lt;P&gt;Please consider the new features, such as report acceleration before attempting the legacy tricky summary index.&lt;/P&gt;</description>
    <pubDate>Thu, 09 Aug 2018 16:31:45 GMT</pubDate>
    <dc:creator>ddrillic</dc:creator>
    <dc:date>2018-08-09T16:31:45Z</dc:date>
    <item>
      <title>How to build a summary index that uses eval statements to configure timechart results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-summary-index-that-uses-eval-statements-to/m-p/397832#M115443</link>
      <description>&lt;P&gt;I am trying to build a summary index to pull a week over week comparison of specific applications. The below query works normally, but for efficiency reasons I would like to place this in a summary index. I am having trouble getting the results I want displayed for the comparison in question. My results with &lt;CODE&gt;sitimechart&lt;/CODE&gt; are using the date and time that the data was ingested into the Summary Index which prevents my comparison method from working. &lt;/P&gt;

&lt;P&gt;The search results off of the summary index places events in a "NULL" column and does not follow the eval statements.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=1 host=1234 sourcetype=sourcetype application=app earliest=-2w@w latest=@w 
| eval marker = if (_time &amp;lt; relative_time(now(), "-1w@w"), "last week", "this week") 
| eval _time = if (marker=="last week", _time + 7*24*60*60, _time)
| timechart count by marker cont=FALSE
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See attached for stats table&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5529i475043900DA2F088/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 16:29:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-summary-index-that-uses-eval-statements-to/m-p/397832#M115443</guid>
      <dc:creator>a109120</dc:creator>
      <dc:date>2018-08-09T16:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a summary index that uses eval statements to configure timechart results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-summary-index-that-uses-eval-statements-to/m-p/397833#M115444</link>
      <description>&lt;P&gt;Please consider the new features, such as report acceleration before attempting the legacy tricky summary index.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 16:31:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-summary-index-that-uses-eval-statements-to/m-p/397833#M115444</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2018-08-09T16:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a summary index that uses eval statements to configure timechart results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-summary-index-that-uses-eval-statements-to/m-p/397834#M115445</link>
      <description>&lt;P&gt;You should try using the &lt;CODE&gt;collect&lt;/CODE&gt; command to put into a summary index and query it. This will also include _time so its broken in the correct days, just as your table is showing &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=1 host=1234 sourcetype=sourcetype application=app earliest=-2w@w latest=@w 
 | eval marker = if (_time &amp;lt; relative_time(now(), "-1w@w"), "last week", "this week") 
 | eval _time = if (marker=="last week", _time + 7*24*60*60, _time)
 | timechart count by marker cont=FALSE
| collect index=summary 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then when its collected, you can then query your summary index &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=summary sourcetype=..
| timechart span=1d max(last_week) AS last_week max(this_week) AS this_week
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Aug 2018 17:26:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-summary-index-that-uses-eval-statements-to/m-p/397834#M115445</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2018-08-09T17:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a summary index that uses eval statements to configure timechart results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-summary-index-that-uses-eval-statements-to/m-p/397835#M115446</link>
      <description>&lt;P&gt;Agreed that an accelerated data model would probably be better, but it would depend on the scenario. An accelerated data model eats up disk space for the additional tsidx files and also consumed 3 concurrent searches every 5 mins to update the summary range. This is a lot of overhead if OP wants a simple solution with minimal overhead. I wouldn't consider a summary index old legacy tricky technology.. ITSI uses it and doesn't plan on ditching it anytime soon&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 17:28:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-summary-index-that-uses-eval-statements-to/m-p/397835#M115446</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2018-08-09T17:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a summary index that uses eval statements to configure timechart results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-summary-index-that-uses-eval-statements-to/m-p/397836#M115447</link>
      <description>&lt;P&gt;Yes that is exactly why I am looking into summary indexing. I am trying to avoid using up the large amount of resources.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 17:52:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-summary-index-that-uses-eval-statements-to/m-p/397836#M115447</guid>
      <dc:creator>a109120</dc:creator>
      <dc:date>2018-08-09T17:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a summary index that uses eval statements to configure timechart results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-summary-index-that-uses-eval-statements-to/m-p/397837#M115448</link>
      <description>&lt;P&gt;I gave this a try and the timechart did not assign any values to the this_week/last_week columns. I think I have a few ideas to get that to work. Thanks for the input &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:50:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-summary-index-that-uses-eval-statements-to/m-p/397837#M115448</guid>
      <dc:creator>a109120</dc:creator>
      <dc:date>2020-09-29T20:50:13Z</dc:date>
    </item>
  </channel>
</rss>

